pub struct RestartTracker { /* private fields */ }Expand description
In-memory bookkeeping for the sliding window. Construct fresh per supervised target (gateway, procserv child, etc.).
Implementations§
Source§impl RestartTracker
impl RestartTracker
pub fn new() -> Self
Sourcepub fn try_record(&mut self, policy: &RestartPolicy) -> Result<(), (u32, u64)>
pub fn try_record(&mut self, policy: &RestartPolicy) -> Result<(), (u32, u64)>
Returns Ok(()) if a fresh restart fits inside policy, in
which case the current timestamp is appended to the window.
Returns Err((max, window_secs)) if the limit was hit.
Trait Implementations§
Source§impl Debug for RestartTracker
impl Debug for RestartTracker
Source§impl Default for RestartTracker
impl Default for RestartTracker
Source§fn default() -> RestartTracker
fn default() -> RestartTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RestartTracker
impl RefUnwindSafe for RestartTracker
impl Send for RestartTracker
impl Sync for RestartTracker
impl Unpin for RestartTracker
impl UnsafeUnpin for RestartTracker
impl UnwindSafe for RestartTracker
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