pub struct SessionsConfig {
pub session_command_buffer: usize,
pub session_event_buffer: usize,
pub limits: SessionLimits,
pub initial_internal_request_timeout: Duration,
pub protocol_breach_request_timeout: Duration,
pub pending_session_timeout: Duration,
}
Expand description
Configuration options for peer session management.
Fields§
§session_command_buffer: usize
Size of the session command buffer (per session task).
session_event_buffer: usize
Size of the session event channel buffer.
limits: SessionLimits
Limits to enforce.
By default, no limits will be enforced.
initial_internal_request_timeout: Duration
The maximum initial time we wait for a response from the peer before we timeout a request internally.
protocol_breach_request_timeout: Duration
The amount of time we continue to wait for a response from the peer, even if we timed it
out internally (initial_internal_request_timeout
). Timeouts are not penalized but the
session directly, however if a peer fails to respond at all (within
PROTOCOL_BREACH_REQUEST_TIMEOUT
) this is considered a protocol violation and results in a
dropped session.
pending_session_timeout: Duration
The timeout after which a pending session attempt is considered failed.
Implementations§
Source§impl SessionsConfig
impl SessionsConfig
Sourcepub const fn with_session_event_buffer(self, n: usize) -> Self
pub const fn with_session_event_buffer(self, n: usize) -> Self
Sets the buffer size for the bounded communication channel between the manager and its sessions for events emitted by the sessions.
It is expected, that the background session task will stall if they outpace the manager. The buffer size provides backpressure on the network I/O.
Sourcepub fn with_upscaled_event_buffer(self, num_peers: usize) -> Self
pub fn with_upscaled_event_buffer(self, num_peers: usize) -> Self
Helper function to set the buffer size for the bounded communication channel between the manager and its sessions for events emitted by the sessions.
This scales the buffer size based on the configured number of peers, where the base line is the default buffer size.
If the number of peers is greater than the default, the buffer size will be scaled up to
match the default buffer size / max peers
ratio.
Note: This is capped at 10 times the default buffer size.
Trait Implementations§
Source§impl Clone for SessionsConfig
impl Clone for SessionsConfig
Source§fn clone(&self) -> SessionsConfig
fn clone(&self) -> SessionsConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SessionsConfig
impl Debug for SessionsConfig
Source§impl Default for SessionsConfig
impl Default for SessionsConfig
Source§impl<'de> Deserialize<'de> for SessionsConfigwhere
SessionsConfig: Default,
impl<'de> Deserialize<'de> for SessionsConfigwhere
SessionsConfig: Default,
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>,
Source§impl PartialEq for SessionsConfig
impl PartialEq for SessionsConfig
Source§impl Serialize for SessionsConfig
impl Serialize for SessionsConfig
impl Eq for SessionsConfig
impl StructuralPartialEq for SessionsConfig
Auto Trait Implementations§
impl Freeze for SessionsConfig
impl RefUnwindSafe for SessionsConfig
impl Send for SessionsConfig
impl Sync for SessionsConfig
impl Unpin for SessionsConfig
impl UnwindSafe for SessionsConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 96 bytes