pub struct RepeatIndex { /* private fields */ }Expand description
Recent answers, per ref, for one session.
Implementations§
Source§impl RepeatIndex
impl RepeatIndex
Sourcepub fn observe(&self, ref_input: &str, code: Option<ErrorCode>)
pub fn observe(&self, ref_input: &str, code: Option<ErrorCode>)
Record what a call told its caller about ref_input: an error code,
or None for a clean success (which clears the ref).
An answer with the same disposition under the same configuration
keeps the FIRST time: a caller looping on a refusal must not slide
the window forward. That rule is also what makes a replay’s own
bookend harmless – it repeats the disposition it replayed (a Wait
reports RATE_LIMITED, which is retry_after like what it waits on)
– without marking requests, so a real answer arriving concurrently
is never mistaken for one. A different disposition, or a success,
replaces the entry.
Sourcepub fn observe_at(
&self,
ref_input: &str,
code: Option<ErrorCode>,
now: Instant,
fingerprint: u64,
)
pub fn observe_at( &self, ref_input: &str, code: Option<ErrorCode>, now: Instant, fingerprint: u64, )
RepeatIndex::observe with an explicit clock and fingerprint.
Trait Implementations§
Source§impl Debug for RepeatIndex
impl Debug for RepeatIndex
Source§impl Default for RepeatIndex
impl Default for RepeatIndex
Source§fn default() -> RepeatIndex
fn default() -> RepeatIndex
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for RepeatIndex
impl RefUnwindSafe for RepeatIndex
impl Send for RepeatIndex
impl Sync for RepeatIndex
impl Unpin for RepeatIndex
impl UnsafeUnpin for RepeatIndex
impl UnwindSafe for RepeatIndex
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