pub struct Devnet { /* private fields */ }Expand description
A local devnet composed of multiple nodes.
Implementations§
Source§impl Devnet
impl Devnet
Sourcepub async fn new(config: DevnetConfig) -> Result<Self>
pub async fn new(config: DevnetConfig) -> Result<Self>
Create a new devnet with the given configuration.
§Errors
Returns DevnetError::Config if the configuration is invalid (e.g. bootstrap
count exceeds node count or port range overflow).
Returns DevnetError::Io if the data directory cannot be created.
Sourcepub async fn start(&mut self) -> Result<()>
pub async fn start(&mut self) -> Result<()>
Start the devnet.
§Errors
Returns DevnetError::Startup if any node fails to start, or
DevnetError::Stabilization if the network does not stabilize within the timeout.
Sourcepub fn config(&self) -> &DevnetConfig
pub fn config(&self) -> &DevnetConfig
Get devnet configuration.
Sourcepub fn bootstrap_addrs(&self) -> Vec<MultiAddr>
pub fn bootstrap_addrs(&self) -> Vec<MultiAddr>
Get bootstrap addresses.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Devnet
impl !RefUnwindSafe for Devnet
impl Send for Devnet
impl Sync for Devnet
impl Unpin for Devnet
impl UnsafeUnpin for Devnet
impl !UnwindSafe for Devnet
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> 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