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>
Source§fn clone(&self) -> ServerState<S>
fn clone(&self) -> ServerState<S>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<S> Freeze for ServerState<S>where
S: Freeze,
impl<S> RefUnwindSafe for ServerState<S>where
S: RefUnwindSafe,
impl<S> Send for ServerState<S>where
S: Send,
impl<S> Sync for ServerState<S>where
S: Sync,
impl<S> Unpin for ServerState<S>where
S: Unpin,
impl<S> UnsafeUnpin for ServerState<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for ServerState<S>where
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