pub struct FailoverManager { /* private fields */ }Expand description
Model failover manager.
Manages auth profile rotation and automatic failover for model providers.
Implementations§
Source§impl FailoverManager
impl FailoverManager
Sourcepub fn register(&mut self, provider: String, config: FailoverConfig)
pub fn register(&mut self, provider: String, config: FailoverConfig)
Register a failover configuration for a provider.
Sourcepub fn select_profile(&self, provider: &str) -> Option<&AuthProfile>
pub fn select_profile(&self, provider: &str) -> Option<&AuthProfile>
Select the next auth profile to use for a provider.
Returns None if no healthy profiles are available.
Sourcepub fn record_success(&self, provider: &str, profile_name: &str)
pub fn record_success(&self, provider: &str, profile_name: &str)
Record a successful request for a profile.
Sourcepub fn record_failure(&self, provider: &str, profile_name: &str)
pub fn record_failure(&self, provider: &str, profile_name: &str)
Record a failed request for a profile.
Sourcepub fn fallback_models(&self, provider: &str) -> &[String]
pub fn fallback_models(&self, provider: &str) -> &[String]
Get fallback model IDs for a provider.
Sourcepub fn health_report(&self) -> HashMap<String, HealthStats>
pub fn health_report(&self) -> HashMap<String, HealthStats>
Get health stats for all profiles.
Sourcepub fn has_failover(&self, provider: &str) -> bool
pub fn has_failover(&self, provider: &str) -> bool
Check if a provider has failover configured.
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 UnsafeUnpin 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