#[non_exhaustive]#[repr(u8)]pub enum ConnectionState {
Connecting = 0,
ClassicalReady = 1,
PqcUpgrading = 2,
PqcReady = 3,
Connected = 4,
Failed = 5,
Closed = 6,
Migrating = 7,
Dead = 8,
}std only.Expand description
Connection state for PhantomSession.
The session is usable from the moment it’s created — sends are queued until the handshake completes.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Connecting = 0
Connection initiated, handshake pending
ClassicalReady = 1
Classical (X25519) channel established — data flows
PqcUpgrading = 2
PQC upgrade in progress
PqcReady = 3
Full hybrid PQC protection active
Connected = 4
Fully connected and operational
Failed = 5
Connection failed
Closed = 6
Gracefully closed
Migrating = 7
The active path went silent (liveness lost); the session is held alive
(keys retained, outbound buffered) awaiting a migrate() or the path’s
return. The embedder reacts by calling migrate() (Phase 4 / P4.3).
Dead = 8
The session is dead: the path stayed down past the migration idle-timeout
with no recovery. Terminal — recv() errors instead of hanging (P4.3).
Implementations§
Source§impl ConnectionState
impl ConnectionState
Sourcepub fn is_data_ready(&self) -> bool
pub fn is_data_ready(&self) -> bool
Whether data can flow (classical or better). Migrating counts as ready:
the keep-alive window still accepts send() (buffered + retransmitted until
the path recovers), so the embedder’s send path doesn’t error mid-migration.
Trait Implementations§
Source§impl Clone for ConnectionState
impl Clone for ConnectionState
Source§fn clone(&self) -> ConnectionState
fn clone(&self) -> ConnectionState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<UT> ConvertError<UT> for ConnectionState
impl<UT> ConvertError<UT> for ConnectionState
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>
impl Copy for ConnectionState
Source§impl Debug for ConnectionState
impl Debug for ConnectionState
impl Eq for ConnectionState
Source§impl<UT> FfiConverter<UT> for ConnectionState
impl<UT> FfiConverter<UT> for ConnectionState
Source§const TYPE_ID_META: MetadataBuffer
const TYPE_ID_META: MetadataBuffer
Source§type FfiType = RustBuffer
type FfiType = RustBuffer
Source§fn lower(v: Self) -> RustBuffer
fn lower(v: Self) -> RustBuffer
Source§fn try_lift(buf: RustBuffer) -> Result<Self>
fn try_lift(buf: RustBuffer) -> Result<Self>
Source§impl<UT> Lift<UT> for ConnectionState
impl<UT> Lift<UT> for ConnectionState
Source§impl<UT> LiftRef<UT> for ConnectionState
impl<UT> LiftRef<UT> for ConnectionState
type LiftType = ConnectionState
Source§impl<UT> LiftReturn<UT> for ConnectionState
impl<UT> LiftReturn<UT> for ConnectionState
Source§type ReturnType = <ConnectionState as Lift<UT>>::FfiType
type ReturnType = <ConnectionState as Lift<UT>>::FfiType
Source§fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
Source§fn lift_foreign_return(
ffi_return: Self::ReturnType,
call_status: RustCallStatus,
) -> Self
fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self
Source§fn lift_error(_buf: RustBuffer) -> Self
fn lift_error(_buf: RustBuffer) -> Self
Source§fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
Source§impl<UT> Lower<UT> for ConnectionState
impl<UT> Lower<UT> for ConnectionState
type FfiType = <ConnectionState as FfiConverter<UT>>::FfiType
fn lower(obj: Self) -> Self::FfiType
fn write(obj: Self, buf: &mut Vec<u8>)
Source§fn lower_into_rust_buffer(obj: Self) -> RustBuffer
fn lower_into_rust_buffer(obj: Self) -> RustBuffer
Source§impl<UT> LowerError<UT> for ConnectionState
impl<UT> LowerError<UT> for ConnectionState
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for ConnectionState
impl<UT> LowerReturn<UT> for ConnectionState
Source§type ReturnType = <ConnectionState as Lower<UT>>::FfiType
type ReturnType = <ConnectionState as Lower<UT>>::FfiType
Source§fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
Source§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl PartialEq for ConnectionState
impl PartialEq for ConnectionState
Source§fn eq(&self, other: &ConnectionState) -> bool
fn eq(&self, other: &ConnectionState) -> bool
self and other values to be equal, and is used by ==.