pub struct Context { /* private fields */ }
Expand description
bitcoin_rest
context.
Implementations§
Source§impl Context
impl Context
Sourcepub async fn call_json<T: for<'de> Deserialize<'de>>(
&self,
path: &str,
) -> Result<T, Error>
pub async fn call_json<T: for<'de> Deserialize<'de>>( &self, path: &str, ) -> Result<T, Error>
Call the REST endpoint and parse it as a JSON.
Sourcepub async fn call_bin(&self, path: &str) -> Result<Bytes, Error>
pub async fn call_bin(&self, path: &str) -> Result<Bytes, Error>
Call the REST endpoint (binary).
Sourcepub async fn call_hex(&self, path: &str) -> Result<String, Error>
pub async fn call_hex(&self, path: &str) -> Result<String, Error>
Call the REST endpoint (hex).
Sourcepub async fn block(&self, blockhash: &BlockHash) -> Result<Block, Error>
pub async fn block(&self, blockhash: &BlockHash) -> Result<Block, Error>
Call the /block endpoint.
Sourcepub async fn block_notxdetails(
&self,
blockhash: &BlockHash,
) -> Result<BlockHeader, Error>
pub async fn block_notxdetails( &self, blockhash: &BlockHash, ) -> Result<BlockHeader, Error>
Call the /block/notxdetails endpoint.
Sourcepub async fn headers(
&self,
count: u32,
blockhash: &BlockHash,
) -> Result<Vec<BlockHeader>, Error>
pub async fn headers( &self, count: u32, blockhash: &BlockHash, ) -> Result<Vec<BlockHeader>, Error>
Call the /headers endpoint.
Sourcepub async fn blockhashbyheight(&self, height: u32) -> Result<BlockHash, Error>
pub async fn blockhashbyheight(&self, height: u32) -> Result<BlockHash, Error>
Call the /blockhashbyheight endpoint.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
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