pub struct BitcoinNode { /* private fields */ }Expand description
[AIR-3][AIS-3][BPC-3] Bitcoin Node implementation for managing Bitcoin Core connectivity
Implementations§
Source§impl BitcoinNode
impl BitcoinNode
Sourcepub fn new(config: BitcoinConfig) -> AnyaResult<Self>
pub fn new(config: BitcoinConfig) -> AnyaResult<Self>
[AIR-3][AIS-3][BPC-3] Create a new Bitcoin node instance
Sourcepub async fn start(&self) -> AnyaResult<()>
pub async fn start(&self) -> AnyaResult<()>
[AIR-3][AIS-3][BPC-3] Start the Bitcoin node connection
Sourcepub async fn stop(&self) -> AnyaResult<()>
pub async fn stop(&self) -> AnyaResult<()>
[AIR-3][AIS-3][BPC-3] Stop the Bitcoin node connection
Sourcepub async fn get_status(&self) -> NodeStatus
pub async fn get_status(&self) -> NodeStatus
[AIR-3][AIS-3][BPC-3] Get current node status
Sourcepub async fn is_connected(&self) -> bool
pub async fn is_connected(&self) -> bool
[AIR-3][AIS-3][BPC-3] Check if node is connected
Sourcepub async fn get_block_height(&self) -> AnyaResult<u64>
pub async fn get_block_height(&self) -> AnyaResult<u64>
[AIR-3][AIS-3][BPC-3] Get current block height
Sourcepub fn get_network(&self) -> String
pub fn get_network(&self) -> String
[AIR-3][AIS-3][BPC-3] Get network information
Sourcepub fn get_config(&self) -> &BitcoinConfig
pub fn get_config(&self) -> &BitcoinConfig
[AIR-3][AIS-3][BPC-3] Get node configuration
Trait Implementations§
Source§impl Clone for BitcoinNode
impl Clone for BitcoinNode
Source§fn clone(&self) -> BitcoinNode
fn clone(&self) -> BitcoinNode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BitcoinNode
impl Debug for BitcoinNode
Auto Trait Implementations§
impl Freeze for BitcoinNode
impl !RefUnwindSafe for BitcoinNode
impl Send for BitcoinNode
impl Sync for BitcoinNode
impl Unpin for BitcoinNode
impl !UnwindSafe for BitcoinNode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more