pub struct BitcoinNodeManager {
pub rpc_port: u16,
/* private fields */
}Expand description
Implementation of the node manager
Fields§
§rpc_port: u16RPC port for communication with the node
Implementations§
Source§impl BitcoinNodeManager
impl BitcoinNodeManager
Sourcepub fn new() -> Result<Self, TransportError>
pub fn new() -> Result<Self, TransportError>
Create a new node manager with default configuration
Examples found in repository?
examples/basic.rs (line 7)
6async fn main() -> Result<(), Box<dyn std::error::Error>> {
7 let mut manager = BitcoinNodeManager::new()?;
8 manager.start().await?;
9 let client: Arc<DefaultTransport> = manager.create_transport().await?;
10
11 let result = client.get_blockchain_info().await?;
12 println!("Blockchain info: {:?}", result);
13
14 manager.stop().await?;
15
16 Ok(())
17}Sourcepub fn new_with_config(config: &TestConfig) -> Result<Self, TransportError>
pub fn new_with_config(config: &TestConfig) -> Result<Self, TransportError>
Create a new node manager with custom configuration
Sourcepub fn config(&self) -> &TestConfig
pub fn config(&self) -> &TestConfig
Gets the test configuration used by this node manager
Sourcepub fn rpc_username(&self) -> &str
pub fn rpc_username(&self) -> &str
Get the RPC username from the configuration
Sourcepub fn rpc_password(&self) -> &str
pub fn rpc_password(&self) -> &str
Get the RPC password from the configuration
Trait Implementations§
Source§impl Debug for BitcoinNodeManager
impl Debug for BitcoinNodeManager
Source§impl NodeManager for BitcoinNodeManager
impl NodeManager for BitcoinNodeManager
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<NodeState, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn rpc_username(&self) -> &str
fn rpc_username(&self) -> &str
Return the RPC username this manager was configured with
Source§fn rpc_password(&self) -> &str
fn rpc_password(&self) -> &str
Return the RPC password this manager was configured with
Source§fn create_transport<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Arc<DefaultTransport>, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_transport<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Arc<DefaultTransport>, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a transport for communicating with the node
Auto Trait Implementations§
impl Freeze for BitcoinNodeManager
impl !RefUnwindSafe for BitcoinNodeManager
impl Send for BitcoinNodeManager
impl Sync for BitcoinNodeManager
impl Unpin for BitcoinNodeManager
impl !UnwindSafe for BitcoinNodeManager
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