pub struct CbfClient { /* private fields */ }Implementations§
Source§impl CbfClient
impl CbfClient
Sourcepub async fn next_info(&self) -> Result<Info, CbfError>
pub async fn next_info(&self) -> Result<Info, CbfError>
Return the next available info message from a node. If none is returned, the node has stopped.
Sourcepub async fn next_warning(&self) -> Result<Warning, CbfError>
pub async fn next_warning(&self) -> Result<Warning, CbfError>
Return the next available warning message from a node. If none is returned, the node has stopped.
Sourcepub async fn update(&self) -> Result<Update, CbfError>
pub async fn update(&self) -> Result<Update, CbfError>
Return an Update. This is method returns once the node syncs to the rest of
the network or a new block has been gossiped.
Sourcepub async fn broadcast(
&self,
transaction: &Transaction,
) -> Result<Arc<Wtxid>, CbfError>
pub async fn broadcast( &self, transaction: &Transaction, ) -> Result<Arc<Wtxid>, CbfError>
Broadcast a transaction to the network, erroring if the node has stopped running.
Sourcepub async fn min_broadcast_feerate(&self) -> Result<Arc<FeeRate>, CbfError>
pub async fn min_broadcast_feerate(&self) -> Result<Arc<FeeRate>, CbfError>
The minimum fee rate required to broadcast a transcation to all connected peers.
Sourcepub async fn average_fee_rate(
&self,
blockhash: Arc<BlockHash>,
) -> Result<Arc<FeeRate>, CbfError>
pub async fn average_fee_rate( &self, blockhash: Arc<BlockHash>, ) -> Result<Arc<FeeRate>, CbfError>
Fetch the average fee rate for a block by requesting it from a peer. Not recommend for resource-limited devices.
Sourcepub fn connect(&self, peer: Peer) -> Result<(), CbfError>
pub fn connect(&self, peer: Peer) -> Result<(), CbfError>
Add another Peer to attempt a connection with.
Sourcepub fn lookup_host(&self, hostname: String) -> Vec<Arc<IpAddress>>
pub fn lookup_host(&self, hostname: String) -> Vec<Arc<IpAddress>>
Query a Bitcoin DNS seeder using the configured resolver.
This is not a generic DNS implementation. Host names are prefixed with a x849 to filter
for compact block filter nodes from the seeder. For example dns.myseeder.com will be queried
as x849.dns.myseeder.com. This has no guarantee to return any IpAddr.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if the node is still running in the background.
Trait Implementations§
Source§impl<UT> LowerError<UT> for CbfClient
impl<UT> LowerError<UT> for CbfClient
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for CbfClient
impl<UT> LowerReturn<UT> for CbfClient
Source§type ReturnType = <Arc<CbfClient> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<CbfClient> as LowerReturn<UniFfiTag>>::ReturnType
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Auto Trait Implementations§
impl !Freeze for CbfClient
impl !RefUnwindSafe for CbfClient
impl Send for CbfClient
impl Sync for CbfClient
impl Unpin for CbfClient
impl UnwindSafe for CbfClient
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
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more