Struct bitcoincore_rest::RestClient
source · [−]pub struct RestClient { /* private fields */ }
Expand description
Creates HTTP requests to bitcoind
Implementations
sourceimpl RestClient
impl RestClient
sourcepub fn new(endpoint: String) -> Self
pub fn new(endpoint: String) -> Self
Create a new RestClient
instance with given endpoint url
Must be in the format "http://{ip}:{port}/rest/"
sourcepub fn network_default(network: Network) -> Self
pub fn network_default(network: Network) -> Self
Create a new RestClient
instance with the default endpoint for that network
For example, Network::Bitcoin
creates an instance with "http://localhost:8332/rest/"
Trait Implementations
sourceimpl Clone for RestClient
impl Clone for RestClient
sourcefn clone(&self) -> RestClient
fn clone(&self) -> RestClient
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl RestApi for RestClient
impl RestApi for RestClient
sourcefn get_json<'life0, 'life1, 'async_trait, T>(
&'life0 self,
path: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>where
T: 'async_trait + for<'a> Deserialize<'a>,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_json<'life0, 'life1, 'async_trait, T>(
&'life0 self,
path: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>where
T: 'async_trait + for<'a> Deserialize<'a>,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get a response from a
json
endpointsourcefn get_bin<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Bytes, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_bin<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Bytes, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get a response from a
bin
endpointsourcefn get_block_headers<'life0, 'life1, 'async_trait>(
&'life0 self,
start_hash: &'life1 BlockHash,
count: u32
) -> Pin<Box<dyn Future<Output = Result<Vec<BlockHeader>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn get_block_headers<'life0, 'life1, 'async_trait>(
&'life0 self,
start_hash: &'life1 BlockHash,
count: u32
) -> Pin<Box<dyn Future<Output = Result<Vec<BlockHeader>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Get a series of block headers beginning from a block hash Read more
sourcefn get_block_at_height<'life0, 'async_trait>(
&'life0 self,
height: u64
) -> Pin<Box<dyn Future<Output = Result<Block, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn get_block_at_height<'life0, 'async_trait>(
&'life0 self,
height: u64
) -> Pin<Box<dyn Future<Output = Result<Block, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
Convenience function to get a block at a specific height
sourcefn get_block_hash<'life0, 'async_trait>(
&'life0 self,
height: u64
) -> Pin<Box<dyn Future<Output = Result<BlockHash, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn get_block_hash<'life0, 'async_trait>(
&'life0 self,
height: u64
) -> Pin<Box<dyn Future<Output = Result<BlockHash, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
Get a block hash at a specific height Read more
sourcefn get_block<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 BlockHash
) -> Pin<Box<dyn Future<Output = Result<Block, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn get_block<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 BlockHash
) -> Pin<Box<dyn Future<Output = Result<Block, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Get a block by its hash Read more
sourcefn get_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
txid: &'life1 Txid
) -> Pin<Box<dyn Future<Output = Result<Transaction, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn get_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
txid: &'life1 Txid
) -> Pin<Box<dyn Future<Output = Result<Transaction, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Get a transaction by its
txid
Read moresourcefn get_block_filter_headers<'life0, 'life1, 'async_trait>(
&'life0 self,
start_hash: &'life1 BlockHash,
count: u32
) -> Pin<Box<dyn Future<Output = Result<Vec<FilterHeader>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn get_block_filter_headers<'life0, 'life1, 'async_trait>(
&'life0 self,
start_hash: &'life1 BlockHash,
count: u32
) -> Pin<Box<dyn Future<Output = Result<Vec<FilterHeader>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Get a series of block filter headers beginning from a block hash Read more
sourcefn get_block_filter<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 BlockHash
) -> Pin<Box<dyn Future<Output = Result<BlockFilter, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn get_block_filter<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 BlockHash
) -> Pin<Box<dyn Future<Output = Result<BlockFilter, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Get a block filter for a given block hash Read more
sourcefn get_chain_info<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<GetBlockchainInfoResult, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn get_chain_info<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<GetBlockchainInfoResult, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
Get info on the block chain state Read more
sourcefn get_utxos<'life0, 'async_trait>(
&'life0 self,
outpoints: Vec<OutPoint>,
check_mempool: bool
) -> Pin<Box<dyn Future<Output = Result<GetUtxosResult, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn get_utxos<'life0, 'async_trait>(
&'life0 self,
outpoints: Vec<OutPoint>,
check_mempool: bool
) -> Pin<Box<dyn Future<Output = Result<GetUtxosResult, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
Get utxos for a given set of outpoints Read more
Auto Trait Implementations
impl !RefUnwindSafe for RestClient
impl Send for RestClient
impl Sync for RestClient
impl Unpin for RestClient
impl !UnwindSafe for RestClient
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more