pub struct Warmth { /* private fields */ }Expand description
Keep-warm bookkeeping for the prefixes one session has sent.
Implementations§
Source§impl Warmth
impl Warmth
pub fn new(setting: KeepWarm) -> Warmth
Sourcepub fn sent(&mut self, request: &ModelRequest<'_>, at_ms: u64)
pub fn sent(&mut self, request: &ModelRequest<'_>, at_ms: u64)
A real request carrying request.segments was sent at at_ms.
Sourcepub fn next_due(&self, lead: &Lead) -> Option<u64>
pub fn next_due(&self, lead: &Lead) -> Option<u64>
The instant the earliest renewal is sent with the lead lead
reads now, or None when no prefix is to be renewed and a timer
need not wake.
Sourcepub fn renew_due(
&mut self,
lead: &Lead,
now_ms: u64,
send: impl FnMut(&ModelRequest<'_>) -> Result<ModelReturn, AxError>,
) -> RenewalRound
pub fn renew_due( &mut self, lead: &Lead, now_ms: u64, send: impl FnMut(&ModelRequest<'_>) -> Result<ModelReturn, AxError>, ) -> RenewalRound
Hands every renewal due by now_ms to send, one at a time.
Every answer comes back in the round, a refusal beside the
answers that preceded it rather than instead of them: their usage
the caller owes the ledger all the same. Nothing more is sent
after a refusal, and a prefix that owes no renewal is let go
here.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Warmth
impl RefUnwindSafe for Warmth
impl Send for Warmth
impl Sync for Warmth
impl Unpin for Warmth
impl UnsafeUnpin for Warmth
impl UnwindSafe for Warmth
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