pub struct DegradationManager { /* private fields */ }Expand description
Graceful degradation manager.
Implementations§
Source§impl DegradationManager
impl DegradationManager
Sourcepub fn with_policy(policy: LoadSheddingPolicy) -> Arc<Self>
pub fn with_policy(policy: LoadSheddingPolicy) -> Arc<Self>
Create with custom policy.
Sourcepub fn level(&self) -> DegradationLevel
pub fn level(&self) -> DegradationLevel
Get current degradation level.
Sourcepub fn set_level(&self, new_level: DegradationLevel)
pub fn set_level(&self, new_level: DegradationLevel)
Set degradation level.
Sourcepub fn on_level_change<F>(&self, callback: F)
pub fn on_level_change<F>(&self, callback: F)
Register level change callback.
Sourcepub fn should_shed(&self) -> bool
pub fn should_shed(&self) -> bool
Check if request should be shed.
Sourcepub fn is_feature_disabled(&self, required_level: DegradationLevel) -> bool
pub fn is_feature_disabled(&self, required_level: DegradationLevel) -> bool
Check if a feature should be disabled at current level.
Sourcepub fn stats(&self) -> DegradationStats
pub fn stats(&self) -> DegradationStats
Get shedding statistics.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DegradationManager
impl !RefUnwindSafe for DegradationManager
impl Send for DegradationManager
impl Sync for DegradationManager
impl Unpin for DegradationManager
impl !UnwindSafe for DegradationManager
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.