pub struct ConfigBuilder<S: State = Empty> { /* private fields */ }Expand description
Use builder syntax to set the inputs and finish with internal_build().
Implementations§
Source§impl<S: State> ConfigBuilder<S>
impl<S: State> ConfigBuilder<S>
Sourcepub(crate) fn internal_build(self) -> Configwhere
S: IsComplete,
pub(crate) fn internal_build(self) -> Configwhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn noise_protocols(
self,
it: impl IntoIterator<Item = (Version, Protocol)>,
) -> ConfigBuilder<SetNoiseProtocols<S>>where
S::NoiseProtocols: IsUnset,
pub fn noise_protocols(
self,
it: impl IntoIterator<Item = (Version, Protocol)>,
) -> ConfigBuilder<SetNoiseProtocols<S>>where
S::NoiseProtocols: IsUnset,
Required.
The supported noise protocols.
Nodes negotiate a common supported version which implies the exact noise protocol parameters they are going to use for the subsequent handshake.
With this map, a node specifies the noise protocol names it supports per version number.
Sourcepub fn keypair(self, value: Keypair) -> ConfigBuilder<SetKeypair<S>>
pub fn keypair(self, value: Keypair) -> ConfigBuilder<SetKeypair<S>>
Required.
DH keypair
Sourcepub fn bind(self, value: NetAddr) -> ConfigBuilder<SetBind<S>>
pub fn bind(self, value: NetAddr) -> ConfigBuilder<SetBind<S>>
Required.
Address to bind to.
Sourcepub fn parties(
self,
iter: impl IntoIterator<Item = (PublicKey, NetAddr)>,
) -> ConfigBuilder<SetParties<S>>
pub fn parties( self, iter: impl IntoIterator<Item = (PublicKey, NetAddr)>, ) -> ConfigBuilder<SetParties<S>>
Required.
Network members with public key and network address.
Sourcepub fn peer_budget(self, value: NonZeroUsize) -> ConfigBuilder<SetPeerBudget<S>>where
S::PeerBudget: IsUnset,
pub fn peer_budget(self, value: NonZeroUsize) -> ConfigBuilder<SetPeerBudget<S>>where
S::PeerBudget: IsUnset,
Sourcepub fn maybe_peer_budget(
self,
value: Option<NonZeroUsize>,
) -> ConfigBuilder<SetPeerBudget<S>>where
S::PeerBudget: IsUnset,
pub fn maybe_peer_budget(
self,
value: Option<NonZeroUsize>,
) -> ConfigBuilder<SetPeerBudget<S>>where
S::PeerBudget: IsUnset,
Sourcepub fn max_message_size(
self,
value: NonZeroUsize,
) -> ConfigBuilder<SetMaxMessageSize<S>>where
S::MaxMessageSize: IsUnset,
pub fn max_message_size(
self,
value: NonZeroUsize,
) -> ConfigBuilder<SetMaxMessageSize<S>>where
S::MaxMessageSize: IsUnset,
Sourcepub fn maybe_max_message_size(
self,
value: Option<NonZeroUsize>,
) -> ConfigBuilder<SetMaxMessageSize<S>>where
S::MaxMessageSize: IsUnset,
pub fn maybe_max_message_size(
self,
value: Option<NonZeroUsize>,
) -> ConfigBuilder<SetMaxMessageSize<S>>where
S::MaxMessageSize: IsUnset,
Sourcepub fn connect_retry_delays(
self,
it: impl IntoIterator<Item = u8>,
) -> ConfigBuilder<SetConnectRetryDelays<S>>where
S::ConnectRetryDelays: IsUnset,
pub fn connect_retry_delays(
self,
it: impl IntoIterator<Item = u8>,
) -> ConfigBuilder<SetConnectRetryDelays<S>>where
S::ConnectRetryDelays: IsUnset,
Sourcepub fn maybe_connect_retry_delays(
self,
value: Option<impl IntoIterator<Item = u8>>,
) -> ConfigBuilder<SetConnectRetryDelays<S>>where
S::ConnectRetryDelays: IsUnset,
pub fn maybe_connect_retry_delays(
self,
value: Option<impl IntoIterator<Item = u8>>,
) -> ConfigBuilder<SetConnectRetryDelays<S>>where
S::ConnectRetryDelays: IsUnset,
Sourcepub fn send_retry_delays(
self,
it: impl IntoIterator<Item = u8>,
) -> ConfigBuilder<SetSendRetryDelays<S>>where
S::SendRetryDelays: IsUnset,
pub fn send_retry_delays(
self,
it: impl IntoIterator<Item = u8>,
) -> ConfigBuilder<SetSendRetryDelays<S>>where
S::SendRetryDelays: IsUnset,
Sourcepub fn maybe_send_retry_delays(
self,
value: Option<impl IntoIterator<Item = u8>>,
) -> ConfigBuilder<SetSendRetryDelays<S>>where
S::SendRetryDelays: IsUnset,
pub fn maybe_send_retry_delays(
self,
value: Option<impl IntoIterator<Item = u8>>,
) -> ConfigBuilder<SetSendRetryDelays<S>>where
S::SendRetryDelays: IsUnset,
Sourcepub fn random_connect_delay(
self,
value: bool,
) -> ConfigBuilder<SetRandomConnectDelay<S>>where
S::RandomConnectDelay: IsUnset,
pub fn random_connect_delay(
self,
value: bool,
) -> ConfigBuilder<SetRandomConnectDelay<S>>where
S::RandomConnectDelay: IsUnset,
Sourcepub fn maybe_random_connect_delay(
self,
value: Option<bool>,
) -> ConfigBuilder<SetRandomConnectDelay<S>>where
S::RandomConnectDelay: IsUnset,
pub fn maybe_random_connect_delay(
self,
value: Option<bool>,
) -> ConfigBuilder<SetRandomConnectDelay<S>>where
S::RandomConnectDelay: IsUnset,
Sourcepub fn connect_timeout(
self,
value: Duration,
) -> ConfigBuilder<SetConnectTimeout<S>>where
S::ConnectTimeout: IsUnset,
pub fn connect_timeout(
self,
value: Duration,
) -> ConfigBuilder<SetConnectTimeout<S>>where
S::ConnectTimeout: IsUnset,
Sourcepub fn maybe_connect_timeout(
self,
value: Option<Duration>,
) -> ConfigBuilder<SetConnectTimeout<S>>where
S::ConnectTimeout: IsUnset,
pub fn maybe_connect_timeout(
self,
value: Option<Duration>,
) -> ConfigBuilder<SetConnectTimeout<S>>where
S::ConnectTimeout: IsUnset,
Sourcepub fn handshake_timeout(
self,
value: Duration,
) -> ConfigBuilder<SetHandshakeTimeout<S>>where
S::HandshakeTimeout: IsUnset,
pub fn handshake_timeout(
self,
value: Duration,
) -> ConfigBuilder<SetHandshakeTimeout<S>>where
S::HandshakeTimeout: IsUnset,
Sourcepub fn maybe_handshake_timeout(
self,
value: Option<Duration>,
) -> ConfigBuilder<SetHandshakeTimeout<S>>where
S::HandshakeTimeout: IsUnset,
pub fn maybe_handshake_timeout(
self,
value: Option<Duration>,
) -> ConfigBuilder<SetHandshakeTimeout<S>>where
S::HandshakeTimeout: IsUnset,
Sourcepub fn receive_timeout(
self,
value: Duration,
) -> ConfigBuilder<SetReceiveTimeout<S>>where
S::ReceiveTimeout: IsUnset,
pub fn receive_timeout(
self,
value: Duration,
) -> ConfigBuilder<SetReceiveTimeout<S>>where
S::ReceiveTimeout: IsUnset,
Sourcepub fn maybe_receive_timeout(
self,
value: Option<Duration>,
) -> ConfigBuilder<SetReceiveTimeout<S>>where
S::ReceiveTimeout: IsUnset,
pub fn maybe_receive_timeout(
self,
value: Option<Duration>,
) -> ConfigBuilder<SetReceiveTimeout<S>>where
S::ReceiveTimeout: IsUnset,
Sourcepub fn backoff_duration(
self,
value: Duration,
) -> ConfigBuilder<SetBackoffDuration<S>>where
S::BackoffDuration: IsUnset,
pub fn backoff_duration(
self,
value: Duration,
) -> ConfigBuilder<SetBackoffDuration<S>>where
S::BackoffDuration: IsUnset,
Sourcepub fn maybe_backoff_duration(
self,
value: Option<Duration>,
) -> ConfigBuilder<SetBackoffDuration<S>>where
S::BackoffDuration: IsUnset,
pub fn maybe_backoff_duration(
self,
value: Option<Duration>,
) -> ConfigBuilder<SetBackoffDuration<S>>where
S::BackoffDuration: IsUnset,
Sourcepub fn metrics(self, value: Arc<dyn Metrics>) -> ConfigBuilder<SetMetrics<S>>
pub fn metrics(self, value: Arc<dyn Metrics>) -> ConfigBuilder<SetMetrics<S>>
Sourcepub fn maybe_metrics(
self,
value: Option<Arc<dyn Metrics>>,
) -> ConfigBuilder<SetMetrics<S>>
pub fn maybe_metrics( self, value: Option<Arc<dyn Metrics>>, ) -> ConfigBuilder<SetMetrics<S>>
Source§impl<S: IsComplete> ConfigBuilder<S>
impl<S: IsComplete> ConfigBuilder<S>
Auto Trait Implementations§
impl<S> Freeze for ConfigBuilder<S>
impl<S = Empty> !RefUnwindSafe for ConfigBuilder<S>
impl<S> Send for ConfigBuilder<S>
impl<S> Sync for ConfigBuilder<S>
impl<S> Unpin for ConfigBuilder<S>
impl<S> UnsafeUnpin for ConfigBuilder<S>
impl<S = Empty> !UnwindSafe for ConfigBuilder<S>
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