pub struct CreditWindow {
pub budget: u64,
pub available: u64,
}Expand description
Dynamic counterpart of the §41.c credit index !ⁿA.S. Tracks the
number of in-flight sends the producer is currently allowed; a send
decrements available, a recv refills it (capped at budget,
standard TCP-window semantics). The static analysis
(SessionType::credit_analyse) has already verified the protocol is
conformant under this budget — this is the runtime safety net for an
off-spec peer.
Serialize + Deserialize — §Fase 41.g sealed-snapshot resume carries
the live window (available count, not just the budget) so a resumed
connection picks up exactly where the disconnected one left off.
Fields§
§budget: u64Maximum credit the producer may hold at any one time (k in the
socket { backpressure: credit(k) } annotation).
available: u64Current available credit. Invariant: 0 ≤ available ≤ budget.
Implementations§
Trait Implementations§
Source§impl Clone for CreditWindow
impl Clone for CreditWindow
Source§fn clone(&self) -> CreditWindow
fn clone(&self) -> CreditWindow
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 CreditWindow
Source§impl Debug for CreditWindow
impl Debug for CreditWindow
Source§impl<'de> Deserialize<'de> for CreditWindow
impl<'de> Deserialize<'de> for CreditWindow
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>,
impl Eq for CreditWindow
Source§impl PartialEq for CreditWindow
impl PartialEq for CreditWindow
Source§fn eq(&self, other: &CreditWindow) -> bool
fn eq(&self, other: &CreditWindow) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for CreditWindow
impl Serialize for CreditWindow
impl StructuralPartialEq for CreditWindow
Auto Trait Implementations§
impl Freeze for CreditWindow
impl RefUnwindSafe for CreditWindow
impl Send for CreditWindow
impl Sync for CreditWindow
impl Unpin for CreditWindow
impl UnsafeUnpin for CreditWindow
impl UnwindSafe for CreditWindow
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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