pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
Sourcepub fn new(url: &str, auth: Auth) -> Result<Self, Error>
pub fn new(url: &str, auth: Auth) -> Result<Self, Error>
Creates a simple_http client with url and auth.
This can fail if we are unable to read the configured Auth::CookieFile.
Sourcepub fn new_user_pass(url: &str, user: String, pass: Option<String>) -> Self
pub fn new_user_pass(url: &str, user: String, pass: Option<String>) -> Self
Creates a simple_http client with user and pass.
Creates a simple_http client with cookie authentication.
Source§impl Client
impl Client
Sourcepub fn get_blockchain_info(&self) -> Result<GetBlockchainInfo, Error>
pub fn get_blockchain_info(&self) -> Result<GetBlockchainInfo, Error>
getblockchaininfo.
Sourcepub fn get_descriptor_info(
&self,
descriptor: &str,
) -> Result<GetDescriptorInfo, Error>
pub fn get_descriptor_info( &self, descriptor: &str, ) -> Result<GetDescriptorInfo, Error>
getdescriptorinfo
Sourcepub fn get_block_count(&self) -> Result<u32, Error>
pub fn get_block_count(&self) -> Result<u32, Error>
getblockcount
Sourcepub fn get_best_block_hash(&self) -> Result<BlockHash, Error>
pub fn get_best_block_hash(&self) -> Result<BlockHash, Error>
getbestblockhash
Sourcepub fn get_block_header_verbose(
&self,
hash: &BlockHash,
) -> Result<GetBlockHeaderVerbose, Error>
pub fn get_block_header_verbose( &self, hash: &BlockHash, ) -> Result<GetBlockHeaderVerbose, Error>
getblockheader (verbose)
Sourcepub fn get_block_filter(
&self,
hash: &BlockHash,
) -> Result<GetBlockFilter, Error>
pub fn get_block_filter( &self, hash: &BlockHash, ) -> Result<GetBlockFilter, Error>
getblockfilter
Sourcepub fn send_to_address(
&self,
address: &Address,
amount: Amount,
) -> Result<Txid, Error>
pub fn send_to_address( &self, address: &Address, amount: Amount, ) -> Result<Txid, Error>
sendtoaddress
Sourcepub fn get_raw_transaction(&self, txid: &Txid) -> Result<Transaction, Error>
pub fn get_raw_transaction(&self, txid: &Txid) -> Result<Transaction, Error>
getrawtransaction
Sourcepub fn import_descriptors(
&self,
requests: &[ImportDescriptorsRequest],
) -> Result<Vec<ImportDescriptorsResponse>, Error>
pub fn import_descriptors( &self, requests: &[ImportDescriptorsRequest], ) -> Result<Vec<ImportDescriptorsResponse>, Error>
importdescriptors
Source§impl Client
impl Client
Sourcepub fn get_block_verbose(
&self,
hash: &BlockHash,
) -> Result<GetBlockVerboseOne, Error>
pub fn get_block_verbose( &self, hash: &BlockHash, ) -> Result<GetBlockVerboseOne, Error>
getblock (verbose = 1)
Sourcepub fn get_raw_mempool_verbose(
&self,
) -> Result<BTreeMap<Txid, MempoolEntry>, Error>
pub fn get_raw_mempool_verbose( &self, ) -> Result<BTreeMap<Txid, MempoolEntry>, Error>
getrawmempool (verbose = true)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more