Struct QuicRelay
pub struct QuicRelay { /* private fields */ }quic and std only.Expand description
Relay dedicated QUIC connections through Rama’s ordinary service boundary.
The input is BridgeIo<Connection, Connection>: ingress is the server
connection and egress is the client connection. This service forwards streams
and optional connection datagrams after both handshakes complete; interception
and certificate negotiation belong to the preceding handshake service.
Ordinary QUIC clients and servers do not construct this opt-in relay.
Implementations§
§impl QuicRelay
impl QuicRelay
pub const fn new(failure_code: VarInt) -> QuicRelay
pub const fn new(failure_code: VarInt) -> QuicRelay
Create a relay with 32 streams per class, 16 KiB copy buffers and no
datagram forwarding. failure_code belongs to the carried application
protocol; QUIC has no universal application error code for relay failure.
pub fn with_streams_per_class(self, limit: NonZero<usize>) -> QuicRelay
pub fn with_streams_per_class(self, limit: NonZero<usize>) -> QuicRelay
Maximum active or opening streams in each of the four classes: ingress/egress initiation, each uni/bidirectional. Credit-blocked openings count toward this limit. At most four times this many stream pairs are retained; accepting one class never starves another.
pub fn set_streams_per_class(&mut self, limit: NonZero<usize>) -> &mut QuicRelay
pub fn set_streams_per_class(&mut self, limit: NonZero<usize>) -> &mut QuicRelay
Maximum active or opening streams in each of the four classes: ingress/egress initiation, each uni/bidirectional. Credit-blocked openings count toward this limit. At most four times this many stream pairs are retained; accepting one class never starves another.
pub fn with_chunk_bytes(self, bytes: NonZero<usize>) -> QuicRelay
pub fn with_chunk_bytes(self, bytes: NonZero<usize>) -> QuicRelay
Maximum bytes in each copy buffer outside the QUIC engines. A uni
stream needs one buffer; a bidirectional stream needs two. All four
full stream classes therefore retain at most 6 * streams_per_class
buffers. Engine flow-control budgets remain independently configured.
pub fn set_chunk_bytes(&mut self, bytes: NonZero<usize>) -> &mut QuicRelay
pub fn set_chunk_bytes(&mut self, bytes: NonZero<usize>) -> &mut QuicRelay
Maximum bytes in each copy buffer outside the QUIC engines. A uni
stream needs one buffer; a bidirectional stream needs two. All four
full stream classes therefore retain at most 6 * streams_per_class
buffers. Engine flow-control budgets remain independently configured.
pub fn with_datagrams(self, enabled: bool) -> QuicRelay
pub fn with_datagrams(self, enabled: bool) -> QuicRelay
Forward native QUIC datagrams in both directions. Configure both
connections’ receive advertisements consistently before handshaking.
Each forwarding direction retains at most one datagram; oversized
datagrams close both connections with failure_code and are never
truncated. This is an intentional failure policy for applications that
require explicit detection of incompatible hop limits; choose receive
limits compatible with both hops before enabling this relay.
pub fn set_datagrams(&mut self, enabled: bool) -> &mut QuicRelay
pub fn set_datagrams(&mut self, enabled: bool) -> &mut QuicRelay
Forward native QUIC datagrams in both directions. Configure both
connections’ receive advertisements consistently before handshaking.
Each forwarding direction retains at most one datagram; oversized
datagrams close both connections with failure_code and are never
truncated. This is an intentional failure policy for applications that
require explicit detection of incompatible hop limits; choose receive
limits compatible with both hops before enabling this relay.
Trait Implementations§
impl Copy for QuicRelay
§impl Service<BridgeIo<Connection, Connection>> for QuicRelay
impl Service<BridgeIo<Connection, Connection>> for QuicRelay
§fn serve(
&self,
_: BridgeIo<Connection, Connection>,
) -> impl Future<Output = Result<(), Box<dyn Error + Sync + Send>>> + Send
fn serve( &self, _: BridgeIo<Connection, Connection>, ) -> impl Future<Output = Result<(), Box<dyn Error + Sync + Send>>> + Send
Relay dedicated, established connections until either connection ends.
ingress is a server connection and egress a client connection.
Both hops must negotiate the same nonempty ALPN. Do not consume their
streams or datagrams concurrently elsewhere. Configure receive datagram
advertisements to match this policy before establishing either hop. Neither
hop may have enabled early-data keys: this generic relay does not decide
application replay safety. Configure TLS early data off on both hops.
Dropping this future closes both connections, including streams waiting
for remote credit. Connection-level transport errors are returned locally
and mapped to failure_code on the other hop; they are not fabricated as
transport errors belonging to that independent connection.
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
Auto Trait Implementations§
impl Freeze for QuicRelay
impl RefUnwindSafe for QuicRelay
impl Send for QuicRelay
impl Sync for QuicRelay
impl Unpin for QuicRelay
impl UnsafeUnpin for QuicRelay
impl UnwindSafe for QuicRelay
Blanket Implementations§
§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
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> 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> ⓘ
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<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§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>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more