pub enum State {
Init,
Negotiating,
Ready,
Disconnected,
Closing,
Closed,
}Expand description
Session lifecycle state.
The session progresses through these states:
Init ──► Negotiating ──► Ready ──► Closing ──► Closed
│ │ │
│ ▼ │
│ Disconnected ────┴──► Closed
│ │
└─────────────┴──────────────► Closed (on error)Variants§
Init
Initial state before negotiation begins.
Negotiating
Handshake in progress (Hello/HelloAck exchange).
Ready
Session is ready for stream operations.
Disconnected
Connection lost but session not yet closed.
The application may attempt to reconnect from this state.
Closing
Graceful shutdown in progress.
Closed
Session has terminated.
Implementations§
Source§impl State
impl State
Sourcepub const fn is_ready(&self) -> bool
pub const fn is_ready(&self) -> bool
Returns true if the session can accept new stream operations.
Sourcepub const fn is_disconnected(&self) -> bool
pub const fn is_disconnected(&self) -> bool
Returns true if the connection was lost.
Sourcepub const fn can_transition_to(&self, target: Self) -> bool
pub const fn can_transition_to(&self, target: Self) -> bool
Returns true if a transition to the target state is valid.
Trait Implementations§
impl Copy for State
impl Eq for State
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
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