pub struct Warmth { /* private fields */ }Expand description
Keep-warm bookkeeping for the prefixes one session has sent.
Implementations§
Source§impl Warmth
impl Warmth
Sourcepub fn new(setting: KeepWarm, lead_ms: u64) -> Warmth
pub fn new(setting: KeepWarm, lead_ms: u64) -> Warmth
lead_ms is the round trip to the provider as the caller measured
it: each renewal leaves that long before the cache expires.
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) -> Option<u64>
pub fn next_due(&self) -> Option<u64>
The instant the earliest renewal is sent, or None when no prefix
is to be renewed and a timer need not wake.
Sourcepub fn renew_due(
&mut self,
model: &mut dyn Model,
now_ms: u64,
) -> Result<Vec<ModelReturn>, AxError>
pub fn renew_due( &mut self, model: &mut dyn Model, now_ms: u64, ) -> Result<Vec<ModelReturn>, AxError>
Sends, through model, every renewal due by now_ms and returns
each one’s answer, whose usage the caller records like any other.
§Errors
The model’s failure, unchanged; the prefixes not yet renewed stay for the next wake.
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