pub struct ServerAdvice { /* private fields */ }Expand description
What one X-Capsule-Advice header said, already clamped into this client’s bounds.
Every member is None where the header did not carry a usable value; the accessors then
answer the caller’s own default.
Implementations§
Source§impl ServerAdvice
impl ServerAdvice
Sourcepub fn parse(header: Option<&str>) -> Self
pub fn parse(header: Option<&str>) -> Self
Read a header value, which may be missing.
Never fails: a missing, oversized or malformed header is Self::absent, an unknown
member is skipped, and a known member whose value is not an integer is treated as absent.
Where a member repeats, the last one wins, as RFC 9651 dictionaries specify.
Sourcepub fn chunk(&self, age: Duration) -> Option<u64>
pub fn chunk(&self, age: Duration) -> Option<u64>
The suggested chunk size, 4 KiB-aligned and within the protocol bounds, or None when
the advice named none or is older than its ttl.
Sourcepub fn sessions_window(&self, own: u32, age: Duration) -> u32
pub fn sessions_window(&self, own: u32, age: Duration) -> u32
The in-flight sessions a lane may hold: the smaller of own and the advice, or own
when the advice named none or is older than its ttl. Never below one.
Sourcepub fn ranges_window(&self, own: u32) -> u32
pub fn ranges_window(&self, own: u32) -> u32
The in-flight ranges a session may hold: the smaller of own and the advice, or own
when the advice named none. Never below one.
Takes no age: the server fixes a session’s in-flight cap at creation, so the ranges a
session was advised holds for that session’s whole life.
Trait Implementations§
Source§impl Clone for ServerAdvice
impl Clone for ServerAdvice
Source§fn clone(&self) -> ServerAdvice
fn clone(&self) -> ServerAdvice
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ServerAdvice
Source§impl Debug for ServerAdvice
impl Debug for ServerAdvice
Source§impl Default for ServerAdvice
impl Default for ServerAdvice
impl Eq for ServerAdvice
Source§impl PartialEq for ServerAdvice
impl PartialEq for ServerAdvice
Source§fn eq(&self, other: &ServerAdvice) -> bool
fn eq(&self, other: &ServerAdvice) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ServerAdvice
Auto Trait Implementations§
impl Freeze for ServerAdvice
impl RefUnwindSafe for ServerAdvice
impl Send for ServerAdvice
impl Sync for ServerAdvice
impl Unpin for ServerAdvice
impl UnsafeUnpin for ServerAdvice
impl UnwindSafe for ServerAdvice
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
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,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§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, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§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>
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