pub struct ServerState<S = ()> {
pub endpoint: Endpoint,
pub health: ServerHealth,
pub status: Option<S>,
pub last_update: Instant,
pub active_requests: usize,
pub total_requests: u64,
pub total_errors: u64,
pub consecutive_failures: u32,
}Fields§
§endpoint: Endpoint§health: ServerHealth§status: Option<S>§last_update: Instant§active_requests: usize§total_requests: u64§total_errors: u64§consecutive_failures: u32Implementations§
Source§impl<S> ServerState<S>
impl<S> ServerState<S>
pub fn new(endpoint: Endpoint) -> Self
pub fn is_available(&self) -> bool
pub fn record_success(&mut self)
pub fn record_failure(&mut self)
Trait Implementations§
Source§impl<S: Clone> Clone for ServerState<S>
impl<S: Clone> Clone for ServerState<S>
Auto Trait Implementations§
impl<S> Freeze for ServerState<S>
impl<S> RefUnwindSafe for ServerState<S>where
Option<S>: RefUnwindSafe,
impl<S> Send for ServerState<S>
impl<S> Sync for ServerState<S>
impl<S> Unpin for ServerState<S>
impl<S> UnsafeUnpin for ServerState<S>where
Option<S>: UnsafeUnpin,
impl<S> UnwindSafe for ServerState<S>where
Option<S>: 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