pub struct RecoveryManager { /* private fields */ }Expand description
Manager for automatic kernel recovery.
Implementations§
Source§impl RecoveryManager
impl RecoveryManager
Sourcepub fn new() -> RecoveryManager
pub fn new() -> RecoveryManager
Create a new recovery manager with default config.
Sourcepub fn with_config(config: RecoveryConfig) -> RecoveryManager
pub fn with_config(config: RecoveryConfig) -> RecoveryManager
Create with specific configuration.
Sourcepub fn set_enabled(&self, enabled: bool)
pub fn set_enabled(&self, enabled: bool)
Enable/disable automatic recovery.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if recovery is enabled.
Sourcepub fn set_config(&self, config: RecoveryConfig)
pub fn set_config(&self, config: RecoveryConfig)
Update configuration.
Sourcepub fn config(&self) -> RecoveryConfig
pub fn config(&self) -> RecoveryConfig
Get current configuration.
Sourcepub fn register_handler(
&self,
policy: RecoveryPolicy,
handler: Arc<dyn Fn(&RecoveryAction) -> Pin<Box<dyn Future<Output = RecoveryResult> + Send>> + Sync + Send>,
)
pub fn register_handler( &self, policy: RecoveryPolicy, handler: Arc<dyn Fn(&RecoveryAction) -> Pin<Box<dyn Future<Output = RecoveryResult> + Send>> + Sync + Send>, )
Register a recovery handler.
Sourcepub fn should_recover(&self, kernel_id: &KernelId) -> bool
pub fn should_recover(&self, kernel_id: &KernelId) -> bool
Check if recovery should be attempted (respects cooldown).
Sourcepub fn determine_action(
&self,
kernel_id: &KernelId,
failure_type: FailureType,
) -> RecoveryAction
pub fn determine_action( &self, kernel_id: &KernelId, failure_type: FailureType, ) -> RecoveryAction
Determine recovery action for a failure.
Sourcepub async fn recover(&self, action: RecoveryAction) -> RecoveryResult
pub async fn recover(&self, action: RecoveryAction) -> RecoveryResult
Execute recovery for a kernel.
Sourcepub fn get_history(&self, kernel_id: &KernelId) -> Vec<RecoveryResult>
pub fn get_history(&self, kernel_id: &KernelId) -> Vec<RecoveryResult>
Get recovery history for a kernel.
Sourcepub fn clear_history(&self)
pub fn clear_history(&self)
Clear recovery history.
Sourcepub fn stats(&self) -> RecoveryStatsSnapshot
pub fn stats(&self) -> RecoveryStatsSnapshot
Get statistics snapshot.
Trait Implementations§
Source§impl Default for RecoveryManager
impl Default for RecoveryManager
Source§fn default() -> RecoveryManager
fn default() -> RecoveryManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for RecoveryManager
impl !RefUnwindSafe for RecoveryManager
impl Send for RecoveryManager
impl Sync for RecoveryManager
impl Unpin for RecoveryManager
impl !UnwindSafe for RecoveryManager
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.