#[repr(u8)]pub enum ConnectionState {
Idle = 0,
Connected = 1,
Reading = 2,
Processing = 3,
Writing = 4,
Closing = 5,
Closed = 6,
Error = 7,
}Expand description
Connection state as a single byte for cache efficiency.
Using #[repr(u8)] ensures the enum is exactly 1 byte,
enabling branchless table lookups via direct indexing.
Variants§
Idle = 0
Connection slot is idle/available
Connected = 1
TCP connection established, awaiting first request
Reading = 2
Reading request headers/body
Processing = 3
Processing request (handler executing)
Writing = 4
Writing response
Closing = 5
Connection closing (graceful)
Closed = 6
Connection closed
Error = 7
Error state
Implementations§
Source§impl ConnectionState
impl ConnectionState
Sourcepub const fn is_terminal(self) -> bool
pub const fn is_terminal(self) -> bool
Check if terminal state.
Sourcepub const fn can_accept_request(self) -> bool
pub const fn can_accept_request(self) -> bool
Check if can accept new request.
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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 Hash for ConnectionState
impl Hash for ConnectionState
Source§impl PartialEq for ConnectionState
impl PartialEq for ConnectionState
impl Copy for ConnectionState
impl Eq 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 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
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
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Injectable for T
impl<T> Injectable for T
Source§fn type_id_of() -> TypeIdwhere
Self: Sized,
fn type_id_of() -> TypeIdwhere
Self: Sized,
Returns the TypeId of this type (for internal use)
Source§fn type_name_of() -> &'static strwhere
Self: Sized,
fn type_name_of() -> &'static strwhere
Self: Sized,
Returns the type name for debugging