pub struct AsyncSecureChannel<T> { /* private fields */ }Expand description
High-level async facade that combines Session, FoctetFramed, and TLV helpers.
This wrapper is intended for async runtimes where callers want:
- automatic session-aware control/rekey handling
- application-data TLV framing by default
- an async send/receive application-data API
Implementations§
Source§impl<T> AsyncSecureChannel<T>
impl<T> AsyncSecureChannel<T>
Sourcepub fn with_app_stream_id(self, stream_id: u32) -> Self
pub fn with_app_stream_id(self, stream_id: u32) -> Self
Sets the default stream ID for application-data frames.
Sourcepub fn with_app_flags(self, flags: u8) -> Self
pub fn with_app_flags(self, flags: u8) -> Self
Sets the default plaintext frame flags for application-data frames.
Sourcepub fn session_mut(&mut self) -> &mut Session
pub fn session_mut(&mut self) -> &mut Session
Returns mutable reference to the underlying Session.
Sourcepub fn framed_ref(&self) -> &FoctetFramed<T>
pub fn framed_ref(&self) -> &FoctetFramed<T>
Returns immutable reference to inner framed transport.
Sourcepub fn framed_mut(&mut self) -> &mut FoctetFramed<T>
pub fn framed_mut(&mut self) -> &mut FoctetFramed<T>
Returns mutable reference to inner framed transport.
Sourcepub fn into_parts(self) -> (FoctetFramed<T>, Session)
pub fn into_parts(self) -> (FoctetFramed<T>, Session)
Consumes the wrapper and returns (framed, session).
Source§impl<T: PollIo + Unpin> AsyncSecureChannel<T>
impl<T: PollIo + Unpin> AsyncSecureChannel<T>
Sourcepub fn from_active_session(io: T, session: Session) -> Result<Self, CoreError>
pub fn from_active_session(io: T, session: Session) -> Result<Self, CoreError>
Constructs an async secure channel from an active session.
The session must already be in Active state with derived traffic keys.
Sourcepub async fn send_data(&mut self, plaintext: &[u8]) -> Result<(), CoreError>
pub async fn send_data(&mut self, plaintext: &[u8]) -> Result<(), CoreError>
Sends application data in an APPLICATION_DATA TLV with session-aware rekey handling.
Sourcepub async fn send_tlvs(&mut self, tlvs: &[Tlv]) -> Result<(), CoreError>
pub async fn send_tlvs(&mut self, tlvs: &[Tlv]) -> Result<(), CoreError>
Sends explicit TLVs with session-aware rekey handling.
This bypasses APPLICATION_DATA convenience framing.
Source§impl<T> AsyncSecureChannel<TokioIo<T>>
impl<T> AsyncSecureChannel<TokioIo<T>>
Sourcepub fn from_tokio(io: T, session: Session) -> Result<Self, CoreError>
pub fn from_tokio(io: T, session: Session) -> Result<Self, CoreError>
Constructs async secure channel from a Tokio I/O object and an active session.
Source§impl<T> AsyncSecureChannel<FuturesIo<T>>
impl<T> AsyncSecureChannel<FuturesIo<T>>
Sourcepub fn from_futures(io: T, session: Session) -> Result<Self, CoreError>
pub fn from_futures(io: T, session: Session) -> Result<Self, CoreError>
Constructs async secure channel from a futures-io object and an active session.