pub struct Session(/* private fields */);๐Deprecated:
use qmux::Session with qmux::ws::accept/connect instead
Expand description
A WebTransport session over WebSocket.
ยงDeprecated
Use qmux::Session with qmux::ws::accept / qmux::ws::connect instead.
Implementationsยง
Sourceยงimpl Session
impl Session
Sourcepub fn accept<T>(ws: T, protocol: Option<String>) -> Self
pub fn accept<T>(ws: T, protocol: Option<String>) -> Self
Wrap a pre-upgraded WebSocket as a server-side session.
Sourcepub fn connect<T>(ws: T, protocol: Option<String>) -> Self
pub fn connect<T>(ws: T, protocol: Option<String>) -> Self
Wrap a pre-upgraded WebSocket as a client-side session.
Sourcepub fn into_inner(self) -> Session
pub fn into_inner(self) -> Session
Get the inner qmux::Session.
Trait Implementationsยง
Sourceยงimpl Session for Session
impl Session for Session
type SendStream = SendStream
type RecvStream = RecvStream
type Error = Error
Sourceยงasync fn accept_uni(&self) -> Result<Self::RecvStream, Self::Error>
async fn accept_uni(&self) -> Result<Self::RecvStream, Self::Error>
Block until the peer creates a new unidirectional stream.
Sourceยงasync fn accept_bi(
&self,
) -> Result<(Self::SendStream, Self::RecvStream), Self::Error>
async fn accept_bi( &self, ) -> Result<(Self::SendStream, Self::RecvStream), Self::Error>
Block until the peer creates a new bidirectional stream.
Sourceยงasync fn open_uni(&self) -> Result<Self::SendStream, Self::Error>
async fn open_uni(&self) -> Result<Self::SendStream, Self::Error>
Open a new unidirectional stream, which may block when there are too many concurrent streams.
Sourceยงasync fn open_bi(
&self,
) -> Result<(Self::SendStream, Self::RecvStream), Self::Error>
async fn open_bi( &self, ) -> Result<(Self::SendStream, Self::RecvStream), Self::Error>
Open a new bidirectional stream, which may block when there are too many concurrent streams.
Sourceยงfn close(&self, code: u32, reason: &str)
fn close(&self, code: u32, reason: &str)
Close the connection immediately with a code and reason.
Sourceยงfn send_datagram(&self, payload: Bytes) -> Result<(), Self::Error>
fn send_datagram(&self, payload: Bytes) -> Result<(), Self::Error>
Send a datagram over the network. Read more
Sourceยงasync fn recv_datagram(&self) -> Result<Bytes, Self::Error>
async fn recv_datagram(&self) -> Result<Bytes, Self::Error>
Receive a datagram over the network.
Sourceยงfn max_datagram_size(&self) -> usize
fn max_datagram_size(&self) -> usize
The maximum size of a datagram that can be sent.
Auto Trait Implementationsยง
impl !RefUnwindSafe for Session
impl !UnwindSafe for Session
impl Freeze for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
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