pub struct FailoverState { /* private fields */ }Implementations§
Source§impl FailoverState
impl FailoverState
pub fn new(profiles: Vec<ProfileConfig>, failure_threshold: u32) -> Self
pub fn active_profile(&self) -> Option<&ProfileConfig>
Sourcepub fn apply_benchmark_order(
&mut self,
ranked: Vec<(ProfileConfig, bool)>,
) -> Option<ProfileConfig>
pub fn apply_benchmark_order( &mut self, ranked: Vec<(ProfileConfig, bool)>, ) -> Option<ProfileConfig>
Reorder profiles and refresh health states from a non-disruptive background benchmark.
Keeps the currently active profile if it is still healthy (zero disruption). If the
active profile is unhealthy and a healthy candidate exists, switches active_index to
the fastest healthy profile and returns it so the caller can activate it.
pub fn record_probe(&mut self, healthy: bool) -> FailoverAction
Auto Trait Implementations§
impl Forget for FailoverState
impl Freeze for FailoverStatewhere
*const u8 is !null: Freeze,
PhantomData<ProfileConfig>: Freeze,
PhantomData<ProfileHealth>: Freeze,
impl Move for FailoverState
impl RefUnwindSafe for FailoverState
impl Send for FailoverStatewhere
RawVecInner: Send,
impl Sync for FailoverStatewhere
RawVecInner: Sync,
impl Unpin for FailoverState
impl UnsafeUnpin for FailoverStatewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<ProfileConfig>: UnsafeUnpin,
PhantomData<ProfileHealth>: UnsafeUnpin,
impl UnwindSafe for FailoverStatewhere
RawVecInner: UnwindSafe,
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