pub struct Session { /* private fields */ }Expand description
A MoQ transport over the worker: raw QUIC, or a WebTransport session.
Request::respond builds the web
flavor; Session::raw wraps a raw-QUIC Connection with the layering
disabled. Clones share the session.
Implementations§
Trait Implementations§
Source§impl Session for Session
impl Session for Session
Source§type SendStream = SendStream
type SendStream = SendStream
The outgoing stream type. Only the poll half is required, so a
!Send
session can hang !Send streams off it.Source§type RecvStream = RecvStream
type RecvStream = RecvStream
The incoming stream type. Only the poll half is required, so a
!Send
session can hang !Send streams off it.Source§fn poll_accept_uni(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Self::RecvStream, Self::Error>>
fn poll_accept_uni( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Self::RecvStream, Self::Error>>
Poll for a unidirectional stream created by the peer.
Source§fn poll_accept_bi(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(Self::SendStream, Self::RecvStream), Self::Error>>
fn poll_accept_bi( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(Self::SendStream, Self::RecvStream), Self::Error>>
Poll for a bidirectional stream created by the peer.
Source§fn poll_open_uni(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Self::SendStream, Self::Error>>
fn poll_open_uni( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Self::SendStream, Self::Error>>
Poll to open a unidirectional stream, which blocks while there are too many
concurrent streams.
Source§fn poll_open_bi(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(Self::SendStream, Self::RecvStream), Self::Error>>
fn poll_open_bi( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(Self::SendStream, Self::RecvStream), Self::Error>>
Poll to open a bidirectional stream, which blocks while there are too many
concurrent streams.
Source§fn poll_send_datagram(
&mut self,
cx: &mut Context<'_>,
payload: &[u8],
) -> Poll<Result<(), Self::Error>>
fn poll_send_datagram( &mut self, cx: &mut Context<'_>, payload: &[u8], ) -> Poll<Result<(), Self::Error>>
Poll to send a datagram over the network. Read more
Source§fn poll_recv_datagram(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Bytes, Self::Error>>
fn poll_recv_datagram( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Bytes, Self::Error>>
Poll for a datagram from 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.
Source§fn protocol(&self) -> Option<&str>
fn protocol(&self) -> Option<&str>
Return the application protocol negotiated for this session, if any. Read more
Source§fn close(&mut self, code: u32, reason: &str)
fn close(&mut self, code: u32, reason: &str)
Close the connection immediately with a code and reason. Read more
Auto Trait Implementations§
impl !Freeze for Session
impl !RefUnwindSafe for Session
impl !Send for Session
impl !Sync for Session
impl !UnwindSafe 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<S> Session for Swhere
S: Session + Clone + 'static,
<S as Session>::SendStream: SendStream,
<S as Session>::RecvStream: RecvStream,
impl<S> Session for Swhere
S: Session + Clone + 'static,
<S as Session>::SendStream: SendStream,
<S as Session>::RecvStream: RecvStream,
Source§fn accept_uni(&mut self) -> AcceptUni<'_, Self> ⓘ
fn accept_uni(&mut self) -> AcceptUni<'_, Self> ⓘ
Accept the next unidirectional stream opened by the peer.
Source§fn accept_bi(&mut self) -> AcceptBi<'_, Self> ⓘ
fn accept_bi(&mut self) -> AcceptBi<'_, Self> ⓘ
Accept the next bidirectional stream opened by the peer.
Source§fn open_uni(&mut self) -> OpenUni<'_, Self> ⓘ
fn open_uni(&mut self) -> OpenUni<'_, Self> ⓘ
Open a unidirectional stream, waiting for stream credit if necessary.
Source§fn open_bi(&mut self) -> OpenBi<'_, Self> ⓘ
fn open_bi(&mut self) -> OpenBi<'_, Self> ⓘ
Open a bidirectional stream, waiting for stream credit if necessary.
Source§fn recv_datagram(&mut self) -> RecvDatagram<'_, Self> ⓘ
fn recv_datagram(&mut self) -> RecvDatagram<'_, Self> ⓘ
Receive the next datagram from the peer.
Source§fn send_datagram(&mut self, payload: &[u8]) -> Result<(), Self::Error>
fn send_datagram(&mut self, payload: &[u8]) -> Result<(), Self::Error>
Send a datagram, best-effort: if the transport has no room for it right
now, the datagram is dropped, exactly as the network is allowed to do.
Source§fn closed(&mut self) -> SessionClosed<'_, Self> ⓘ
fn closed(&mut self) -> SessionClosed<'_, Self> ⓘ
Wait until the session is closed by either side, returning the reason.