pub struct GatewaySession {
pub client_id: ClientId,
pub station_id: StationId,
pub connected_at: Tick,
pub last_seen: Tick,
pub generation: u64,
pub route_epoch: u64,
pub state: GatewaySessionState,
/* private fields */
}Expand description
Tracked client gateway session.
Fields§
§client_id: ClientIdClient id.
station_id: StationIdCurrent target station.
connected_at: TickTick at which this generation was first connected.
last_seen: TickLast tick at which the client was observed.
generation: u64Reconnect generation. External gateways may expose this as an opaque token after adding their own authentication.
route_epoch: u64Route epoch incremented on station route changes.
state: GatewaySessionStateConnection state.
Implementations§
Source§impl GatewaySession
impl GatewaySession
Sourcepub const fn route(&self) -> GatewayRoute
pub const fn route(&self) -> GatewayRoute
Returns a route snapshot.
Sourcepub const fn last_sequence(&self) -> Option<u64>
pub const fn last_sequence(&self) -> Option<u64>
Returns the latest accepted command sequence.
Sourcepub const fn commands_this_tick(&self) -> usize
pub const fn commands_this_tick(&self) -> usize
Returns command count admitted in the currently tracked tick.
Sourcepub const fn is_connected(&self) -> bool
pub const fn is_connected(&self) -> bool
Returns whether the session is connected.
Trait Implementations§
Source§impl Clone for GatewaySession
impl Clone for GatewaySession
Source§fn clone(&self) -> GatewaySession
fn clone(&self) -> GatewaySession
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 GatewaySession
impl Debug for GatewaySession
impl Eq for GatewaySession
Source§impl PartialEq for GatewaySession
impl PartialEq for GatewaySession
impl StructuralPartialEq for GatewaySession
Auto Trait Implementations§
impl Freeze for GatewaySession
impl RefUnwindSafe for GatewaySession
impl Send for GatewaySession
impl Sync for GatewaySession
impl Unpin for GatewaySession
impl UnsafeUnpin for GatewaySession
impl UnwindSafe for GatewaySession
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