Trait Queryable

Source
pub trait Queryable<C: RpcApi>: Sized {
    type Id;

    // Required method
    fn query(rpc: &C, id: &Self::Id) -> Result<Self>;
}
Expand description

A type that can be queried from Bitcoin Core.

Required Associated Types§

Source

type Id

Type of the ID used to query the item.

Required Methods§

Source

fn query(rpc: &C, id: &Self::Id) -> Result<Self>

Query the item using rpc and convert to Self.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<C: RpcApi> Queryable<C> for Option<GetTxOutResult>

Source§

type Id = OutPoint

Source§

fn query(rpc: &C, id: &Self::Id) -> Result<Self>

Source§

impl<C: RpcApi> Queryable<C> for Block

Source§

type Id = BlockHash

Source§

fn query(rpc: &C, id: &Self::Id) -> Result<Self>

Source§

impl<C: RpcApi> Queryable<C> for Transaction

Source§

type Id = Txid

Source§

fn query(rpc: &C, id: &Self::Id) -> Result<Self>

Implementors§