#[non_exhaustive]pub struct SessionStatus {
pub state: ConnectionState,
pub timestamp: i64,
pub session_id: String,
pub zone: String,
pub messages: u64,
pub packets: u64,
pub last_received_seconds: Option<u64>,
}Expand description
Periodic session state suitable for a UI status indicator or health adapter.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.state: ConnectionStateCurrent coarse connection state.
timestamp: i64Unix timestamp when the status was emitted.
session_id: StringUnique identifier for the current process-level session.
zone: StringCurrent short zone name, if known.
messages: u64Number of communication records received in this attempt.
packets: u64Number of application packets received in this attempt.
last_received_seconds: Option<u64>Seconds since the last valid server datagram, if a session is active.
Implementations§
Source§impl SessionStatus
impl SessionStatus
Sourcepub fn new(state: ConnectionState, session_id: impl Into<String>) -> Self
pub fn new(state: ConnectionState, session_id: impl Into<String>) -> Self
Create an empty status snapshot for a connection state and session.
Sourcepub const fn with_timestamp(self, timestamp: i64) -> Self
pub const fn with_timestamp(self, timestamp: i64) -> Self
Replace the timestamp, primarily for imported or synthetic events.
Sourcepub const fn with_counters(self, messages: u64, packets: u64) -> Self
pub const fn with_counters(self, messages: u64, packets: u64) -> Self
Attach current communication and application-packet counters.
Sourcepub const fn with_last_received(self, seconds: Option<u64>) -> Self
pub const fn with_last_received(self, seconds: Option<u64>) -> Self
Attach whole seconds since the last valid server datagram.
Trait Implementations§
Source§impl Clone for SessionStatus
impl Clone for SessionStatus
Source§fn clone(&self) -> SessionStatus
fn clone(&self) -> SessionStatus
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SessionStatus
impl Debug for SessionStatus
Auto Trait Implementations§
impl Freeze for SessionStatus
impl RefUnwindSafe for SessionStatus
impl Send for SessionStatus
impl Sync for SessionStatus
impl Unpin for SessionStatus
impl UnsafeUnpin for SessionStatus
impl UnwindSafe for SessionStatus
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