pub enum ConnectionState {
Closed,
SynSent,
SynReceived,
Established,
FinWait,
Closing,
TimeWait,
}Expand description
Connection state for the constrained protocol
Variants§
Closed
Connection is closed (initial or final state)
SynSent
SYN sent, waiting for SYN-ACK
SynReceived
SYN received, SYN-ACK sent, waiting for ACK
Established
Connection established, data can flow
FinWait
FIN sent, waiting for ACK
Closing
Received FIN, sent ACK, waiting to close
TimeWait
Waiting for enough time to pass before reusing connection ID
Implementations§
Source§impl ConnectionState
impl ConnectionState
Sourcepub const fn can_send_data(&self) -> bool
pub const fn can_send_data(&self) -> bool
Check if this state allows sending data
Sourcepub const fn can_receive_data(&self) -> bool
pub const fn can_receive_data(&self) -> bool
Check if this state allows receiving data
Sourcepub const fn is_established(&self) -> bool
pub const fn is_established(&self) -> bool
Check if connection is fully established
Trait Implementations§
Source§impl Clone for ConnectionState
impl Clone for ConnectionState
Source§fn clone(&self) -> ConnectionState
fn clone(&self) -> ConnectionState
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 moreimpl Copy for ConnectionState
Source§impl Debug for ConnectionState
impl Debug for ConnectionState
Source§impl Default for ConnectionState
impl Default for ConnectionState
Source§fn default() -> ConnectionState
fn default() -> ConnectionState
Returns the “default value” for a type. Read more
Source§impl Display for ConnectionState
impl Display for ConnectionState
impl Eq for ConnectionState
Source§impl Hash for ConnectionState
impl Hash for ConnectionState
Source§impl PartialEq for ConnectionState
impl PartialEq for ConnectionState
impl StructuralPartialEq for ConnectionState
Auto Trait Implementations§
impl Freeze for ConnectionState
impl RefUnwindSafe for ConnectionState
impl Send for ConnectionState
impl Sync for ConnectionState
impl Unpin for ConnectionState
impl UnsafeUnpin for ConnectionState
impl UnwindSafe for ConnectionState
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
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§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
Compare self to
key and return true if they are equal.