pub struct WebTransportSession<P>where
P: Protocol,{ /* private fields */ }Expand description
A JetStream session over a WebTransport session.
Cloning is cheap and every clone addresses the same WebTransport session, so lanes can be opened from several tasks at once.
Implementations§
Source§impl<P> WebTransportSession<P>where
P: Protocol,
impl<P> WebTransportSession<P>where
P: Protocol,
Sourcepub fn new(
session: Arc<WebTransportSession<Connection, Bytes>>,
context: Context,
) -> WebTransportSession<P>
pub fn new( session: Arc<WebTransportSession<Connection, Bytes>>, context: Context, ) -> WebTransportSession<P>
Wrap an accepted WebTransport session.
context is the peer identity the HTTP/3 handshake established —
the client certificate, where there is one.
Trait Implementations§
Source§impl<P> Clone for WebTransportSession<P>where
P: Protocol,
impl<P> Clone for WebTransportSession<P>where
P: Protocol,
Source§fn clone(&self) -> WebTransportSession<P>
fn clone(&self) -> WebTransportSession<P>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<P> Session<P> for WebTransportSession<P>
impl<P> Session<P> for WebTransportSession<P>
Source§fn capabilities(&self) -> Capabilities
fn capabilities(&self) -> Capabilities
r[impl jetstream.session.capabilities]
r[impl jetstream.session.capabilities.degradation]
The conformance row says WebTransport carries datagrams, and
HTTP/3 does. This session does not: there is no
Datagrams<P> impl for it, so there is nothing to send or
receive one with.
Reporting the row whole would be worse than the missing impl.
Code that names this type concretely fails to compile, which is
fine; code that asks require(Capability::Datagrams) — which is
the point of having capabilities at all — would be told yes and
then find no way to use the channel. A capability is what this
session has, not what its transport could do.
Binding h3-webtransport’s datagram handles is the real fix and
belongs with making this type reachable from H3Service at all:
both need an h3 handshake harness the tree does not have.
Source§fn context(&self) -> Context
fn context(&self) -> Context
r[impl jetstream.session.identity] The identity the HTTP/3 handshake established, which for a WebTransport session is the client certificate where one was presented.
Source§fn open_lane<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<<WebTransportSession<P> as Session<P>>::ClientLane, SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
WebTransportSession<P>: 'async_trait,
fn open_lane<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<<WebTransportSession<P> as Session<P>>::ClientLane, SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
WebTransportSession<P>: 'async_trait,
r[impl jetstream.webtransport.upstream-initiated] r[impl jetstream.session.symmetric] The server opening a lane is the ordinary case here, not a special one: the end that opens a lane is the caller on it, so this lane is written as requests and read as responses.
Source§fn accept_lane<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<<WebTransportSession<P> as Session<P>>::ServiceLane, SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
WebTransportSession<P>: 'async_trait,
fn accept_lane<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<<WebTransportSession<P> as Session<P>>::ServiceLane, SessionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
WebTransportSession<P>: 'async_trait,
r[impl jetstream.webtransport.bidi.multi-stream] r[impl jetstream.lane.independence] Each accepted lane is its own WebTransport stream. Streams the peer opens that are HTTP/3 requests rather than WebTransport streams are not lanes, and are skipped.
Source§fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
WebTransportSession<P>: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
WebTransportSession<P>: 'async_trait,
Stop opening and accepting lanes on this session.
r[impl jetstream.session.lifetime]
Partial, and worth stating precisely. This cancels the session:
further opens fail, and an accept already parked inside
accept_bi wakes and returns SessionError::Closed rather
than waiting on an idle peer forever. What it cannot do is
terminate lanes already handed out — h3-webtransport 0.1
exposes no way to close a WebTransport session, so those end by
being dropped or by the underlying QUIC connection going away. A
lane here can therefore outlive its session, which the iroh,
QUIC and in-process bindings all prevent.
Source§type ClientLane = WebTransportClientLane<P>
type ClientLane = WebTransportClientLane<P>
Source§type ServiceLane = WebTransportServiceLane<P>
type ServiceLane = WebTransportServiceLane<P>
Auto Trait Implementations§
impl<P> !Freeze for WebTransportSession<P>
impl<P> !RefUnwindSafe for WebTransportSession<P>
impl<P> !UnwindSafe for WebTransportSession<P>
impl<P> Send for WebTransportSession<P>
impl<P> Sync for WebTransportSession<P>
impl<P> Unpin for WebTransportSession<P>
impl<P> UnsafeUnpin for WebTransportSession<P>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more