pub enum SessionState {
Uninitialised,
Initialising,
Operating,
Closing,
Closed,
Stateless,
}Expand description
Where a session is in its lifecycle.
Variants§
Uninitialised
A connection exists; no handshake has been offered.
Initialising
A handshake was accepted and answered; the peer has not confirmed it.
Operating
The handshake completed. Ordinary work is admitted.
Closing
A close was asked for. In-flight work is being drained; nothing new is admitted.
Closed
Finished. Terminal.
Stateless
No handshake at all: every message negotiates for itself and the session retains nothing between them.
Implementations§
Source§impl SessionState
impl SessionState
Sourcepub const fn admits_ordinary_work(self) -> bool
pub const fn admits_ordinary_work(self) -> bool
Whether ordinary work — anything that is not part of the handshake — may be dispatched in this state.
The gate a lifecycle is asked to refine, not replace: a protocol narrows this further for its own methods, but the engine refuses everything in a closing or closed session regardless of what any lifecycle says.
Sourcepub const fn is_stateless(self) -> bool
pub const fn is_stateless(self) -> bool
Whether the session retains nothing between messages.
Sourcepub const fn is_terminal(self) -> bool
pub const fn is_terminal(self) -> bool
Whether no further transition is possible.