pub struct NetworkConfigBuilder { /* private fields */ }Expand description
A network configuration builder.
Implementations§
Source§impl NetworkConfigBuilder
impl NetworkConfigBuilder
Sourcepub fn with_bind_multiaddr(self, multiaddr: Multiaddr) -> Result<Self, Error>
pub fn with_bind_multiaddr(self, multiaddr: Multiaddr) -> Result<Self, Error>
Specifies the bind addresses.
Sourcepub fn with_reconnect_interval_secs(self, secs: u64) -> Self
pub fn with_reconnect_interval_secs(self, secs: u64) -> Self
Specifies the interval (in seconds) at which known peers are automatically reconnected if possible.
The allowed minimum value for the secs argument is 1.
Sourcepub fn with_max_unknown_peers(self, n: usize) -> Self
pub fn with_max_unknown_peers(self, n: usize) -> Self
Specifies the maximum number of gossip connections with unknown peers.
Sourcepub fn finish(self) -> Result<NetworkConfig, Error>
pub fn finish(self) -> Result<NetworkConfig, Error>
Builds the network config.
Trait Implementations§
Source§impl Default for NetworkConfigBuilder
impl Default for NetworkConfigBuilder
Source§fn default() -> NetworkConfigBuilder
fn default() -> NetworkConfigBuilder
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for NetworkConfigBuilder
impl<'de> Deserialize<'de> for NetworkConfigBuilder
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for NetworkConfigBuilder
impl RefUnwindSafe for NetworkConfigBuilder
impl Send for NetworkConfigBuilder
impl Sync for NetworkConfigBuilder
impl Unpin for NetworkConfigBuilder
impl UnwindSafe for NetworkConfigBuilder
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