pub struct ConnectionFlags(/* private fields */);Expand description
Bit-packed boolean flags for a ConnectionState.
Storing the various closure / chaos flags in a single integer avoids the
clippy::struct_excessive_bools lint while keeping a small, copy-friendly
representation. Helper methods provide named access to each flag.
Implementations§
Source§impl ConnectionFlags
impl ConnectionFlags
Sourcepub fn set_is_closed(&mut self, value: bool)
pub fn set_is_closed(&mut self, value: bool)
Update the closed flag.
Sourcepub fn send_closed(self) -> bool
pub fn send_closed(self) -> bool
Whether the send side has been closed.
Sourcepub fn set_send_closed(&mut self, value: bool)
pub fn set_send_closed(&mut self, value: bool)
Update the send-closed flag.
Sourcepub fn recv_closed(self) -> bool
pub fn recv_closed(self) -> bool
Whether the receive side has been closed.
Sourcepub fn set_recv_closed(&mut self, value: bool)
pub fn set_recv_closed(&mut self, value: bool)
Update the recv-closed flag.
Sourcepub fn set_is_cut(&mut self, value: bool)
pub fn set_is_cut(&mut self, value: bool)
Update the cut flag.
Sourcepub fn is_half_open(self) -> bool
pub fn is_half_open(self) -> bool
Whether the connection is half-open (peer crashed).
Sourcepub fn set_is_half_open(&mut self, value: bool)
pub fn set_is_half_open(&mut self, value: bool)
Update the half-open flag.
Sourcepub fn set_is_stable(&mut self, value: bool)
pub fn set_is_stable(&mut self, value: bool)
Update the stable flag.
Sourcepub fn graceful_close_pending(self) -> bool
pub fn graceful_close_pending(self) -> bool
Whether a graceful close (FIN) is pending delivery to the peer.
Sourcepub fn set_graceful_close_pending(&mut self, value: bool)
pub fn set_graceful_close_pending(&mut self, value: bool)
Update the graceful-close-pending flag.
Sourcepub fn remote_fin_received(self) -> bool
pub fn remote_fin_received(self) -> bool
Whether the peer’s FIN has been received on this side.
Sourcepub fn set_remote_fin_received(&mut self, value: bool)
pub fn set_remote_fin_received(&mut self, value: bool)
Update the remote-fin-received flag.
Sourcepub fn send_in_progress(self) -> bool
pub fn send_in_progress(self) -> bool
Whether a ProcessSendBuffer event is currently scheduled.
Sourcepub fn set_send_in_progress(&mut self, value: bool)
pub fn set_send_in_progress(&mut self, value: bool)
Update the send-in-progress flag.
Trait Implementations§
Source§impl Clone for ConnectionFlags
impl Clone for ConnectionFlags
Source§fn clone(&self) -> ConnectionFlags
fn clone(&self) -> ConnectionFlags
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ConnectionFlags
Source§impl Debug for ConnectionFlags
impl Debug for ConnectionFlags
Source§impl Default for ConnectionFlags
impl Default for ConnectionFlags
Source§fn default() -> ConnectionFlags
fn default() -> ConnectionFlags
impl Eq for ConnectionFlags
Source§impl PartialEq for ConnectionFlags
impl PartialEq for ConnectionFlags
Source§fn eq(&self, other: &ConnectionFlags) -> bool
fn eq(&self, other: &ConnectionFlags) -> bool
self and other values to be equal, and is used by ==.