pub struct SessionConfig {
pub timeout: Duration,
pub max_bytes: u64,
pub max_concurrent_requests: usize,
pub request_timeout: Duration,
pub max_retries: usize,
pub backoff_base: Duration,
}Expand description
Per-session transfer configuration for block exchange operations.
Controls timeouts, concurrency limits, and retry behaviour for a single block-exchange session. Three convenience constructors cover the most common scenarios; individual fields can always be overridden afterwards.
Note: this type lives in the session_config module and is distinct from
crate::session::SessionConfig, which governs higher-level session
orchestration (priorities, concurrent blocks, etc.).
Fields§
§timeout: DurationSession-level timeout. Default: 30 s.
max_bytes: u64Maximum total bytes to transfer in this session. Default: 1 GiB.
max_concurrent_requests: usizeMaximum concurrent block requests. Default: 16.
request_timeout: DurationPer-request timeout. Default: 10 s.
max_retries: usizeMaximum retry attempts per block. Default: 3.
backoff_base: DurationExponential backoff base duration. Default: 200 ms.
Implementations§
Source§impl SessionConfig
impl SessionConfig
Sourcepub fn high_throughput() -> Self
pub fn high_throughput() -> Self
Create a high-throughput config (longer timeouts, more concurrency).
Sourcepub fn low_latency() -> Self
pub fn low_latency() -> Self
Create a low-latency config (short timeouts, fail fast).
Sourcepub fn backoff_for_retry(&self, retry: usize) -> Duration
pub fn backoff_for_retry(&self, retry: usize) -> Duration
Compute backoff duration for retry n using exponential backoff.
backoff = base × 2^min(retry, 6) (capped at 32× base to prevent
runaway growth).
Trait Implementations§
Source§impl Clone for SessionConfig
impl Clone for SessionConfig
Source§fn clone(&self) -> SessionConfig
fn clone(&self) -> SessionConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SessionConfig
impl Debug for SessionConfig
Auto Trait Implementations§
impl Freeze for SessionConfig
impl RefUnwindSafe for SessionConfig
impl Send for SessionConfig
impl Sync for SessionConfig
impl Unpin for SessionConfig
impl UnsafeUnpin for SessionConfig
impl UnwindSafe for SessionConfig
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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