Struct QuicIo
pub struct QuicIo<I> { /* private fields */ }Available on crate feature
std only.Expand description
A Bridge side carrying a QUIC connection.
A QUIC connection is neither a byte stream nor a single message transport: it multiplexes streams and datagrams of its own. Transparent: it derefs to the connection it wraps and forwards that connection’s extensions.
Implementations§
§impl<I> QuicIo<I>
impl<I> QuicIo<I>
pub fn map_inner<U>(self, map: impl FnOnce(I) -> U) -> QuicIo<U>
pub fn map_inner<U>(self, map: impl FnOnce(I) -> U) -> QuicIo<U>
Replace the value this bridge side carries, keeping its kind.
pub fn try_map_inner<U, E>(
self,
map: impl FnOnce(I) -> Result<U, E>,
) -> Result<QuicIo<U>, E>
pub fn try_map_inner<U, E>( self, map: impl FnOnce(I) -> Result<U, E>, ) -> Result<QuicIo<U>, E>
As Self::map_inner, for a replacement that can fail.
pub fn into_inner(self) -> I
pub fn into_inner(self) -> I
Unwrap the value this bridge side carries.
Prefer Self::map_inner to decorate a side in place: a marker
is transparent, so the value it carries rarely has to leave it.
Trait Implementations§
§impl<I> AsSocketRef for QuicIo<I>where
I: AsSocketRef,
impl<I> AsSocketRef for QuicIo<I>where
I: AsSocketRef,
§fn as_socket_ref(&self) -> SockRef<'_>
fn as_socket_ref(&self) -> SockRef<'_>
Return a non-owning reference to this socket.
§impl<C> Connection for QuicIo<C>where
C: Connection,
impl<C> Connection for QuicIo<C>where
C: Connection,
type SendStream = <C as Connection>::SendStream
type RecvStream = <C as Connection>::RecvStream
type CloseLease = <C as Connection>::CloseLease
fn open_bi( &self, ) -> impl Future<Output = Result<(<QuicIo<C> as Connection>::SendStream, <QuicIo<C> as Connection>::RecvStream), ConnectionError>> + Send
fn open_uni( &self, ) -> impl Future<Output = Result<<QuicIo<C> as Connection>::SendStream, ConnectionError>> + Send
§fn accept_bi(
&self,
) -> impl Future<Output = Result<(<QuicIo<C> as Connection>::SendStream, <QuicIo<C> as Connection>::RecvStream), ConnectionError>> + Send
fn accept_bi( &self, ) -> impl Future<Output = Result<(<QuicIo<C> as Connection>::SendStream, <QuicIo<C> as Connection>::RecvStream), ConnectionError>> + Send
Accept the next peer-initiated bidirectional stream.
Queued incoming streams remain available after connection closure, before the terminal error.
§fn accept_uni(
&self,
) -> impl Future<Output = Result<<QuicIo<C> as Connection>::RecvStream, ConnectionError>> + Send
fn accept_uni( &self, ) -> impl Future<Output = Result<<QuicIo<C> as Connection>::RecvStream, ConnectionError>> + Send
Accept the next peer-initiated unidirectional stream.
Queued incoming streams remain available after connection closure, before the terminal error,
so HTTP/3 can drain buffered control and QPACK data.
§fn side(&self) -> Side
fn side(&self) -> Side
Which stream IDs are locally initiated. Must match the IDs the streams report.
§fn handshake_confirmed(
&self,
) -> impl Future<Output = Result<(), ConnectionError>> + Send
fn handshake_confirmed( &self, ) -> impl Future<Output = Result<(), ConnectionError>> + Send
Application data can be sent without 0-RTT replay risk.
Before resolving successfully, publish the negotiated
Config::application_protocol in
NegotiatedTlsParameters in the shared extensions.§fn is_handshake_confirmed(&self) -> bool
fn is_handshake_confirmed(&self) -> bool
Whether
Self::handshake_confirmed resolved successfully; stays true after closing.fn close(&self, error_code: VarInt, reason: &[u8])
fn closed(&self) -> impl Future<Output = ConnectionError> + Send
fn close_reason(&self) -> Option<ConnectionError>
§fn available_streams(&self, dir: Dir) -> u64
fn available_streams(&self, dir: Dir) -> u64
Locally initiated streams that can be opened now.
§fn max_concurrent_streams(&self, dir: Dir) -> u64
fn max_concurrent_streams(&self, dir: Dir) -> u64
Streams this endpoint allows the peer to have open at once.
§fn remote_stream_limit(&self, dir: Dir) -> u64
fn remote_stream_limit(&self, dir: Dir) -> u64
Cumulative count of streams this endpoint allows the peer to open.
§fn local_stream_limit(&self, dir: Dir) -> u64
fn local_stream_limit(&self, dir: Dir) -> u64
Cumulative count of streams the peer allows this endpoint to open.
§fn early_data(&self) -> EarlyData
fn early_data(&self) -> EarlyData
Where this client’s early data stands.
§fn early_data_context_matches(&self, context: &[u8]) -> bool
fn early_data_context_matches(&self, context: &[u8]) -> bool
Whether server TLS acceptance is bound to this application’s encoded
compatibility context. Return false when no context was configured.
This is not evidence that any particular request arrived early.
§fn qlog_control(&self) -> Option<ConnectionQlogControl>
fn qlog_control(&self) -> Option<ConnectionQlogControl>
The qlog sink HTTP/3 events are written to.
§fn read_datagram(
&self,
) -> impl Future<Output = Result<Bytes, ConnectionError>> + Send
fn read_datagram( &self, ) -> impl Future<Output = Result<Bytes, ConnectionError>> + Send
Receive the next QUIC DATAGRAM payload.
Dropping a pending future must not discard a datagram; HTTP/3 selects this future
alongside other connection work.
fn max_datagram_size(&self) -> Option<usize>
§fn datagram_receive_enabled(&self) -> bool
fn datagram_receive_enabled(&self) -> bool
The peer may send QUIC DATAGRAM frames to this endpoint.
§fn received_datagrams(&self) -> usize
fn received_datagrams(&self) -> usize
Datagrams received and not yet taken by
Self::read_datagram.§fn datagram_send_ready(
&self,
) -> impl Future<Output = ()> + Send + 'static + use<C>
fn datagram_send_ready( &self, ) -> impl Future<Output = ()> + Send + 'static + use<C>
Room on the datagram send queue, or the connection closed. Registered when called:
create it before a send that may be refused as blocked and await it after the refusal.
§fn close_lease(&self) -> <QuicIo<C> as Connection>::CloseLease
fn close_lease(&self) -> <QuicIo<C> as Connection>::CloseLease
Holds off this connection’s close at a graceful shutdown until dropped, so a tunnel
can still send what it carries.
§impl<I> ExtensionsMut for QuicIo<I>where
I: ExtensionsMut,
impl<I> ExtensionsMut for QuicIo<I>where
I: ExtensionsMut,
§fn extensions_mut(&mut self) -> &mut Extensions
fn extensions_mut(&mut self) -> &mut Extensions
Get the replaceable extension store owned by this input.
§impl<I> ExtensionsRef for QuicIo<I>where
I: ExtensionsRef,
impl<I> ExtensionsRef for QuicIo<I>where
I: ExtensionsRef,
§fn extensions(&self) -> &Extensions
fn extensions(&self) -> &Extensions
Get reference to the underlying
Extensions store§impl<C> ReserveBiStreams for QuicIo<C>where
C: ReserveBiStreams,
impl<C> ReserveBiStreams for QuicIo<C>where
C: ReserveBiStreams,
type Reservation = <C as ReserveBiStreams>::Reservation
§fn try_reserve_bi(
&self,
) -> Result<Option<<QuicIo<C> as ReserveBiStreams>::Reservation>, ConnectionError>
fn try_reserve_bi( &self, ) -> Result<Option<<QuicIo<C> as ReserveBiStreams>::Reservation>, ConnectionError>
None before the handshake completes or while credit is exhausted.§fn subscribe_bi_stream_budget(&self, listener: Weak<dyn ChangeListener>)
fn subscribe_bi_stream_budget(&self, listener: Weak<dyn ChangeListener>)
Notify
listener when locally initiated bidirectional stream credit becomes available,
the handshake completes, or the connection closes, until the listener is dropped.
Acquiring or consuming a reservation need not notify listeners. Subscribe before trying
to reserve credit to avoid missing a notification.§impl<T> Socket for QuicIo<T>where
T: Socket,
impl<T> Socket for QuicIo<T>where
T: Socket,
§fn local_addr(&self) -> Result<SocketAddress, Error>
fn local_addr(&self) -> Result<SocketAddress, Error>
Try to get the local address of the socket.
§fn peer_addr(&self) -> Result<SocketAddress, Error>
fn peer_addr(&self) -> Result<SocketAddress, Error>
Try to get the remote address of the socket.
Auto Trait Implementations§
impl<I> Forget for QuicIo<I>
impl<I> Freeze for QuicIo<I>where
I: Freeze,
impl<I> Move for QuicIo<I>
impl<I> RefUnwindSafe for QuicIo<I>where
I: RefUnwindSafe,
impl<I> Send for QuicIo<I>where
I: Send,
impl<I> Sync for QuicIo<I>where
I: Sync,
impl<I> Unpin for QuicIo<I>where
I: Unpin,
impl<I> UnsafeUnpin for QuicIo<I>where
I: UnsafeUnpin,
impl<I> UnwindSafe for QuicIo<I>where
I: UnwindSafe,
Blanket Implementations§
§impl<T, A, P> Access<T> for P
impl<T, A, P> Access<T> for P
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> ClientExt for T
impl<T> ClientExt for T
fn with_metadata(&self, metadata: impl Into<Metadata>) -> Self
fn with_timeout(&self, timeout: impl Into<Timeout>) -> Self
fn with_context(&self, context: impl Into<Context>) -> Self
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<R> CryptoRng for R
impl<T> CryptoRng for T
§impl<T, A> DynAccess<T> for Awhere
A: Access<T>,
<A as Access<T>>::Guard: 'static,
impl<T, A> DynAccess<T> for Awhere
A: Access<T>,
<A as Access<T>>::Guard: 'static,
impl<T> Formattable for T
§impl<T> ForwardedClientExt for Twhere
T: ExtensionsRef + ?Sized,
impl<T> ForwardedClientExt for Twhere
T: ExtensionsRef + ?Sized,
§fn trusted_forwarded(&self) -> Option<&Forwarded>
fn trusted_forwarded(&self) -> Option<&Forwarded>
The chain as recorded, unless it came from a peer the policy does not trust: what may
be selected from, or passed on to the next hop as this connection’s history.
§fn forwarded_client(&self) -> Option<&ForwardedElement>
fn forwarded_client(&self) -> Option<&ForwardedElement>
The element describing the client.
§fn forwarded_client_ip(&self) -> Option<IpAddr>
fn forwarded_client_ip(&self) -> Option<IpAddr>
The client’s IP, from its
for node.§fn forwarded_client_socket_addr(&self) -> Option<SocketAddress>
fn forwarded_client_socket_addr(&self) -> Option<SocketAddress>
The client’s IP and port, from its
for node.§fn forwarded_client_host(&self) -> Option<&ForwardedAuthority>
fn forwarded_client_host(&self) -> Option<&ForwardedAuthority>
The host the client asked for.
§fn forwarded_client_proto(&self) -> Option<ForwardedProtocol>
fn forwarded_client_proto(&self) -> Option<ForwardedProtocol>
The protocol the client used.
§fn forwarded_client_version(&self) -> Option<ForwardedVersion>
fn forwarded_client_version(&self) -> Option<ForwardedVersion>
The HTTP version the client used.
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§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> ⓘ
Converts
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> ⓘ
Converts
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<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a rama_grpc::Requestimpl<T> Parsable for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Create a new
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<R> Rng for R
impl<R> Rng for R
Source§impl<R> Rng for R
impl<R> Rng for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
Return a random value via the
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘ
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘ
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Generate a random value in the given range. Read more
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
Return a bool with a probability
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
Return a bool with a probability of
numerator/denominator of being
true. Read moreSource§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Sample a new value, using the given distribution. Read more
Source§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
Create an iterator that generates values using the given distribution. Read more
Source§fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
👎Deprecated since 0.9.0:
Renamed to random to avoid conflict with the new gen keyword in Rust 2024.
Alias for
Rng::random.Source§fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
👎Deprecated since 0.9.0:
Renamed to random_range
Alias for
Rng::random_range.impl<R> RngCore for Rwhere
R: Rng,
§impl<R> RngExt for Rwhere
R: Rng + ?Sized,
impl<R> RngExt for Rwhere
R: Rng + ?Sized,
§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
Return a random value via the
StandardUniform distribution. Read more§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘwhere
Self: Sized,
StandardUniform: Distribution<T>,
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘwhere
Self: Sized,
StandardUniform: Distribution<T>,
§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Generate a random value in the given range. Read more
§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
Return a bool with a probability
p of being true. Read more§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
Return a bool with a probability of
numerator/denominator of being
true. Read more§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Sample a new value, using the given distribution. Read more
§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
Create an iterator that generates values using the given distribution. Read more
impl<R> TryCryptoRng for R
impl<R> TryCryptoRng for R
§impl<R> TryRng for R
impl<R> TryRng for R
§type Error = <<R as Deref>::Target as TryRng>::Error
type Error = <<R as Deref>::Target as TryRng>::Error
The type returned in the event of a RNG error. Read more
§fn try_next_u32(&mut self) -> Result<u32, <R as TryRng>::Error>
fn try_next_u32(&mut self) -> Result<u32, <R as TryRng>::Error>
Return the next random
u32.§fn try_next_u64(&mut self) -> Result<u64, <R as TryRng>::Error>
fn try_next_u64(&mut self) -> Result<u64, <R as TryRng>::Error>
Return the next random
u64.§fn try_fill_bytes(&mut self, dst: &mut [u8]) -> Result<(), <R as TryRng>::Error>
fn try_fill_bytes(&mut self, dst: &mut [u8]) -> Result<(), <R as TryRng>::Error>
Fill
dst entirely with random data.§impl<R> TryRngCore for Rwhere
R: TryRng,
impl<R> TryRngCore for Rwhere
R: TryRng,
Source§impl<R> TryRngCore for R
impl<R> TryRngCore for R
Source§fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
Return the next random
u32.Source§fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
Return the next random
u64.Source§fn try_fill_bytes(
&mut self,
dst: &mut [u8],
) -> Result<(), <R as TryRngCore>::Error>
fn try_fill_bytes( &mut self, dst: &mut [u8], ) -> Result<(), <R as TryRngCore>::Error>
Fill
dest entirely with random data.Source§fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
Wrap RNG with the
UnwrapMut wrapper.Source§fn read_adapter(&mut self) -> RngReadAdapter<'_, Self> ⓘwhere
Self: Sized,
fn read_adapter(&mut self) -> RngReadAdapter<'_, Self> ⓘwhere
Self: Sized,
Available on crate feature
std only.Convert an
RngCore to a RngReadAdapter.