Trait Api

Source
pub trait Api:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn getblockhash(&self, height: usize) -> Result<BlockHash, Error>;
    fn getblockheader(
        &self,
        blockhash: BlockHash,
        verbose: bool,
    ) -> Result<String, Error>;
    fn getblock(
        &self,
        blockhash: BlockHash,
        verbosity: u64,
    ) -> Result<String, Error>;
    fn get_raw_transaction(
        &self,
        txid: Txid,
        verbose: bool,
        blockhash: Option<BlockHash>,
    ) -> Result<Value, Error>;
    fn list_unspent(
        &self,
        minconf: Option<usize>,
        maxconf: Option<usize>,
        address: Option<Address>,
        include_unsafe: Option<bool>,
        query_options: Option<String>,
    ) -> Result<Vec<ListUnspentResultEntry>, Error>;

    // Provided method
    fn to_delegate<M: Metadata>(self) -> IoDelegate<Self, M> { ... }
}

Required Methods§

Source

fn getblockhash(&self, height: usize) -> Result<BlockHash, Error>

Source

fn getblockheader( &self, blockhash: BlockHash, verbose: bool, ) -> Result<String, Error>

Source

fn getblock( &self, blockhash: BlockHash, verbosity: u64, ) -> Result<String, Error>

Source

fn get_raw_transaction( &self, txid: Txid, verbose: bool, blockhash: Option<BlockHash>, ) -> Result<Value, Error>

Source

fn list_unspent( &self, minconf: Option<usize>, maxconf: Option<usize>, address: Option<Address>, include_unsafe: Option<bool>, query_options: Option<String>, ) -> Result<Vec<ListUnspentResultEntry>, Error>

Provided Methods§

Source

fn to_delegate<M: Metadata>(self) -> IoDelegate<Self, M>

Create an IoDelegate, wiring rpc calls to the trait methods.

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.

Implementors§