pub struct Session<T: AsyncRead + AsyncWrite + Send + Unpin + 'static> { /* private fields */ }
Expand description
Network multiplexing session
Session
is the core component of network multiplexing, managing multiple independent streams
over a single underlying connection. Each session can handle multiple streams simultaneously,
with each stream having its own unique stream ID and lifecycle.
Implementations§
Source§impl<T: AsyncRead + AsyncWrite + Send + Unpin + 'static> Session<T>
impl<T: AsyncRead + AsyncWrite + Send + Unpin + 'static> Session<T>
Sourcepub async fn open(&self) -> Result<Stream, Error>
pub async fn open(&self) -> Result<Stream, Error>
Open a new stream
This method allocates a new stream ID, creates the corresponding stream object, and sends a SYN frame to establish the connection. The returned stream can be used for data transmission.
Auto Trait Implementations§
impl<T> !Freeze for Session<T>
impl<T> !RefUnwindSafe for Session<T>
impl<T> Send for Session<T>
impl<T> Sync for Session<T>where
T: Sync,
impl<T> Unpin for Session<T>
impl<T> !UnwindSafe for Session<T>
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