pub enum SessionState {
Idle,
Handshaking,
Connected,
ControlTypeSelected(ControlType),
Closed(CloseReason),
}Expand description
Where a session has got to.
Connected and ControlTypeSelected are the standard’s own two states,
WebSocketConnected and ControlTypeActivated. The rest are this crate’s: a session
that has not started, one that is mid-handshake, and one that is over.
Variants§
Idle
Nothing has been sent yet.
Handshaking
The handshake is in progress.
Connected
WebSocketConnected: details, measurements and forecasts flow.
ControlTypeSelected(ControlType)
ControlTypeActivated. Note that NOT_CONTROLABLE is a legal selection and
lands here too, with nothing control-type specific allowed after it.
Closed(CloseReason)
Over, and why.
Implementations§
Source§impl SessionState
impl SessionState
Sourcepub fn phase(&self) -> Phase
pub fn phase(&self) -> Phase
Which row of S2C §State of communication this session is on.
Idle and Handshaking are both
Phase::Negotiating: a session that has not
opened and one that is mid-handshake have the same answer to “may this message
cross?”, which is no, the two sides have not agreed which schema to read it
against.
A Closed session reports
Phase::Connected and nothing reads
it: every path that consults the table refuses on is_closed
first.
Sourcepub fn active_control_type(&self) -> Option<ControlType>
pub fn active_control_type(&self) -> Option<ControlType>
The control type that is active, if it is one that can be instructed.
Trait Implementations§
Source§impl Clone for SessionState
impl Clone for SessionState
Source§impl Debug for SessionState
impl Debug for SessionState
impl Eq for SessionState
Source§impl PartialEq for SessionState
impl PartialEq for SessionState
impl StructuralPartialEq for SessionState
Auto Trait Implementations§
impl Forget for SessionState
impl Freeze for SessionState
impl Move for SessionState
impl RefUnwindSafe for SessionState
impl Send for SessionState
impl Sync for SessionState
impl Unpin for SessionState
impl UnsafeUnpin for SessionState
impl UnwindSafe for SessionState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.