pub struct FailoverManager { /* private fields */ }Expand description
Failover manager implementing automatic failover patterns Follows the Leader and Followers pattern from distributed systems [AIR-3][AIS-3][RES-3]
Implementations§
Source§impl FailoverManager
impl FailoverManager
Sourcepub fn new(config: &HighAvailabilityConfig) -> Self
pub fn new(config: &HighAvailabilityConfig) -> Self
Creates a new failover manager
Sourcepub async fn initialize(&mut self) -> Result<(), HaError>
pub async fn initialize(&mut self) -> Result<(), HaError>
Initializes the failover manager
Sourcepub async fn trigger_manual_failover(&mut self) -> Result<(), HaError>
pub async fn trigger_manual_failover(&mut self) -> Result<(), HaError>
Triggers a manual failover
Sourcepub async fn trigger_failover(
&mut self,
trigger: FailoverTrigger,
source_node: Option<String>,
target_node: Option<String>,
) -> Result<(), HaError>
pub async fn trigger_failover( &mut self, trigger: FailoverTrigger, source_node: Option<String>, target_node: Option<String>, ) -> Result<(), HaError>
Triggers failover for a specific reason
Sourcepub async fn update_config(
&mut self,
config: &HighAvailabilityConfig,
) -> Result<(), HaError>
pub async fn update_config( &mut self, config: &HighAvailabilityConfig, ) -> Result<(), HaError>
Updates the failover manager configuration
Sourcepub async fn get_current_phase(&self) -> FailoverPhase
pub async fn get_current_phase(&self) -> FailoverPhase
Gets the current failover phase
Sourcepub async fn get_failover_history(&self) -> Vec<FailoverEvent>
pub async fn get_failover_history(&self) -> Vec<FailoverEvent>
Gets the failover history
Sourcepub async fn is_failover_active(&self) -> bool
pub async fn is_failover_active(&self) -> bool
Checks if failover is currently active
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FailoverManager
impl !RefUnwindSafe for FailoverManager
impl Send for FailoverManager
impl Sync for FailoverManager
impl Unpin for FailoverManager
impl !UnwindSafe for FailoverManager
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more