pub struct BitcoinD {
pub client: Client,
pub params: ConnectParams,
/* private fields */
}
Expand description
Struct representing the bitcoind process with related information
Fields§
§client: Client
Rpc client linked to this bitcoind process
params: ConnectParams
Contains information to connect to this node
Implementations§
source§impl BitcoinD
impl BitcoinD
sourcepub fn new<S: AsRef<OsStr>>(exe: S) -> Result<BitcoinD>
pub fn new<S: AsRef<OsStr>>(exe: S) -> Result<BitcoinD>
Launch the bitcoind process from the given exe
executable with default args.
Waits for the node to be ready to accept connections before returning
sourcepub fn with_conf<S: AsRef<OsStr>>(exe: S, conf: &Conf<'_>) -> Result<BitcoinD>
pub fn with_conf<S: AsRef<OsStr>>(exe: S, conf: &Conf<'_>) -> Result<BitcoinD>
Launch the bitcoind process from the given exe
executable with given Conf param
sourcepub fn rpc_url(&self) -> String
pub fn rpc_url(&self) -> String
Returns the rpc URL including the schema eg. http://127.0.0.1:44842
sourcepub fn p2p_connect(&self, listen: bool) -> Option<P2P>
pub fn p2p_connect(&self, listen: bool) -> Option<P2P>
Returns the P2P enum to connect to this node p2p port
sourcepub fn stop(&mut self) -> Result<ExitStatus>
pub fn stop(&mut self) -> Result<ExitStatus>
Stop the node, waiting correct process termination
source§impl BitcoinD
impl BitcoinD
sourcepub fn from_downloaded() -> Result<BitcoinD>
Available on crate feature download
only.
pub fn from_downloaded() -> Result<BitcoinD>
download
only.create BitcoinD struct with the downloaded executable.
sourcepub fn from_downloaded_with_conf(conf: &Conf<'_>) -> Result<BitcoinD>
Available on crate feature download
only.
pub fn from_downloaded_with_conf(conf: &Conf<'_>) -> Result<BitcoinD>
download
only.create BitcoinD struct with the downloaded executable and given Conf.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for BitcoinD
impl !RefUnwindSafe for BitcoinD
impl Send for BitcoinD
impl Sync for BitcoinD
impl Unpin for BitcoinD
impl !UnwindSafe for BitcoinD
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> 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