Struct ConnectUdpMitmRelay
pub struct ConnectUdpMitmRelay<S> { /* private fields */ }masque only.Expand description
Adapt accepted HTTP tunnel legs to a service over context-zero datagrams.
Custom control capsules and nonzero contexts continue through the transparent
relay. For policy based on a first flight, use Self::routed with a peeker.
The HTTP relay owns both streams for the lifetime of the tunnel. Its end
cancels any pending inner service. An inner error aborts both streams.
By default a successful UDP service drains queued replies and closes the tunnel.
See ConnectUdpServiceEnd for applications with independent sideband protocols.
By default each direction retains up to 512 events while peeking and pauses
reads once retained payloads reach 1 MiB. See ConnectUdpRelayBuffers.
A peeker with a deadline can still select forwarding while reads are paused.
Implementations§
§impl<S> ConnectUdpMitmRelay<S>
impl<S> ConnectUdpMitmRelay<S>
pub fn routed(inner: S) -> ConnectUdpMitmRelay<S>
pub fn routed(inner: S) -> ConnectUdpMitmRelay<S>
Run inner on a peekable tunnel. It can forward, take the UDP bridge,
or refuse by returning without accepting either path.
pub fn with_service_end(
self,
end: ConnectUdpServiceEnd,
) -> ConnectUdpMitmRelay<S>
pub fn with_service_end( self, end: ConnectUdpServiceEnd, ) -> ConnectUdpMitmRelay<S>
Select the tunnel lifetime after successful inspection. Defaults to closing the tunnel.
pub fn set_service_end(
&mut self,
end: ConnectUdpServiceEnd,
) -> &mut ConnectUdpMitmRelay<S>
pub fn set_service_end( &mut self, end: ConnectUdpServiceEnd, ) -> &mut ConnectUdpMitmRelay<S>
Select the tunnel lifetime after successful inspection. Defaults to closing the tunnel.
pub fn with_extensions_transfer(
self,
transfer: impl ExtensionsTransfer,
) -> ConnectUdpMitmRelay<S>
pub fn with_extensions_transfer( self, transfer: impl ExtensionsTransfer, ) -> ConnectUdpMitmRelay<S>
Select which connection-scoped extensions each UDP socket keeps from
its own HTTP leg. Defaults to DefaultExtensionsTransfer.
pub fn set_extensions_transfer(
&mut self,
transfer: impl ExtensionsTransfer,
) -> &mut ConnectUdpMitmRelay<S>
pub fn set_extensions_transfer( &mut self, transfer: impl ExtensionsTransfer, ) -> &mut ConnectUdpMitmRelay<S>
Select which connection-scoped extensions each UDP socket keeps from
its own HTTP leg. Defaults to DefaultExtensionsTransfer.
pub fn with_buffers(
self,
buffers: ConnectUdpRelayBuffers,
) -> ConnectUdpMitmRelay<S>
pub fn with_buffers( self, buffers: ConnectUdpRelayBuffers, ) -> ConnectUdpMitmRelay<S>
Configure queue and peek limits independently of the carrier’s framing limits.
pub fn set_buffers(
&mut self,
buffers: ConnectUdpRelayBuffers,
) -> &mut ConnectUdpMitmRelay<S>
pub fn set_buffers( &mut self, buffers: ConnectUdpRelayBuffers, ) -> &mut ConnectUdpMitmRelay<S>
Configure queue and peek limits independently of the carrier’s framing limits.
pub fn maybe_with_idle_timeout(
self,
timeout: Option<Duration>,
) -> ConnectUdpMitmRelay<S>
pub fn maybe_with_idle_timeout( self, timeout: Option<Duration>, ) -> ConnectUdpMitmRelay<S>
Bound inactivity across both legs. Defaults to two minutes.
pub fn maybe_set_idle_timeout(
&mut self,
timeout: Option<Duration>,
) -> &mut ConnectUdpMitmRelay<S>
pub fn maybe_set_idle_timeout( &mut self, timeout: Option<Duration>, ) -> &mut ConnectUdpMitmRelay<S>
Bound inactivity across both legs. Defaults to two minutes.
pub fn with_idle_timeout(self, timeout: Duration) -> ConnectUdpMitmRelay<S>
pub fn with_idle_timeout(self, timeout: Duration) -> ConnectUdpMitmRelay<S>
Bound inactivity across both legs. Defaults to two minutes.
pub fn set_idle_timeout(
&mut self,
timeout: Duration,
) -> &mut ConnectUdpMitmRelay<S>
pub fn set_idle_timeout( &mut self, timeout: Duration, ) -> &mut ConnectUdpMitmRelay<S>
Bound inactivity across both legs. Defaults to two minutes.
pub fn without_idle_timeout(self) -> ConnectUdpMitmRelay<S>
pub fn without_idle_timeout(self) -> ConnectUdpMitmRelay<S>
Bound inactivity across both legs. Defaults to two minutes.
pub fn unset_idle_timeout(&mut self) -> &mut ConnectUdpMitmRelay<S>
pub fn unset_idle_timeout(&mut self) -> &mut ConnectUdpMitmRelay<S>
Bound inactivity across both legs. Defaults to two minutes.
pub fn maybe_with_close_timeout(
self,
timeout: Option<Duration>,
) -> ConnectUdpMitmRelay<S>
pub fn maybe_with_close_timeout( self, timeout: Option<Duration>, ) -> ConnectUdpMitmRelay<S>
Bound draining after one forwarding direction finishes. Defaults to five seconds.
pub fn maybe_set_close_timeout(
&mut self,
timeout: Option<Duration>,
) -> &mut ConnectUdpMitmRelay<S>
pub fn maybe_set_close_timeout( &mut self, timeout: Option<Duration>, ) -> &mut ConnectUdpMitmRelay<S>
Bound draining after one forwarding direction finishes. Defaults to five seconds.
pub fn with_close_timeout(self, timeout: Duration) -> ConnectUdpMitmRelay<S>
pub fn with_close_timeout(self, timeout: Duration) -> ConnectUdpMitmRelay<S>
Bound draining after one forwarding direction finishes. Defaults to five seconds.
pub fn set_close_timeout(
&mut self,
timeout: Duration,
) -> &mut ConnectUdpMitmRelay<S>
pub fn set_close_timeout( &mut self, timeout: Duration, ) -> &mut ConnectUdpMitmRelay<S>
Bound draining after one forwarding direction finishes. Defaults to five seconds.
pub fn without_close_timeout(self) -> ConnectUdpMitmRelay<S>
pub fn without_close_timeout(self) -> ConnectUdpMitmRelay<S>
Bound draining after one forwarding direction finishes. Defaults to five seconds.
pub fn unset_close_timeout(&mut self) -> &mut ConnectUdpMitmRelay<S>
pub fn unset_close_timeout(&mut self) -> &mut ConnectUdpMitmRelay<S>
Bound draining after one forwarding direction finishes. Defaults to five seconds.
pub fn with_scope(self, scope: impl Into<WeakScope>) -> ConnectUdpMitmRelay<S>
pub fn with_scope(self, scope: impl Into<WeakScope>) -> ConnectUdpMitmRelay<S>
Tie both tunnel legs to the server’s shutdown scope.
pub fn set_scope(
&mut self,
scope: impl Into<WeakScope>,
) -> &mut ConnectUdpMitmRelay<S>
pub fn set_scope( &mut self, scope: impl Into<WeakScope>, ) -> &mut ConnectUdpMitmRelay<S>
Tie both tunnel legs to the server’s shutdown scope.
§impl<S> ConnectUdpMitmRelay<MapInput<S, fn(ConnectUdpTunnel) -> Bridge<MessageIo<TunnelDatagramSocket>, MessageIo<TunnelDatagramSocket>>>>
impl<S> ConnectUdpMitmRelay<MapInput<S, fn(ConnectUdpTunnel) -> Bridge<MessageIo<TunnelDatagramSocket>, MessageIo<TunnelDatagramSocket>>>>
pub fn new(
inner: S,
) -> ConnectUdpMitmRelay<MapInput<S, fn(ConnectUdpTunnel) -> Bridge<MessageIo<TunnelDatagramSocket>, MessageIo<TunnelDatagramSocket>>>>
pub fn new( inner: S, ) -> ConnectUdpMitmRelay<MapInput<S, fn(ConnectUdpTunnel) -> Bridge<MessageIo<TunnelDatagramSocket>, MessageIo<TunnelDatagramSocket>>>>
Run an ordinary datagram bridge service without a separate routing step.
Trait Implementations§
§impl<S> Clone for ConnectUdpMitmRelay<S>where
S: Clone,
impl<S> Clone for ConnectUdpMitmRelay<S>where
S: Clone,
§fn clone(&self) -> ConnectUdpMitmRelay<S>
fn clone(&self) -> ConnectUdpMitmRelay<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<S> Debug for ConnectUdpMitmRelay<S>where
S: Debug,
impl<S> Debug for ConnectUdpMitmRelay<S>where
S: Debug,
§impl<L, R, S> Service<Bridge<ByteIo<L>, ByteIo<R>>> for ConnectUdpMitmRelay<S>where
L: Io + Unpin + ExtensionsRef,
R: Io + Unpin + ExtensionsRef,
S: Service<ConnectUdpTunnel>,
<S as Service<ConnectUdpTunnel>>::Error: Into<Box<dyn Error + Send + Sync>>,
impl<L, R, S> Service<Bridge<ByteIo<L>, ByteIo<R>>> for ConnectUdpMitmRelay<S>where
L: Io + Unpin + ExtensionsRef,
R: Io + Unpin + ExtensionsRef,
S: Service<ConnectUdpTunnel>,
<S as Service<ConnectUdpTunnel>>::Error: Into<Box<dyn Error + Send + Sync>>,
Auto Trait Implementations§
impl<S> !RefUnwindSafe for ConnectUdpMitmRelay<S>
impl<S> !UnwindSafe for ConnectUdpMitmRelay<S>
impl<S> Forget for ConnectUdpMitmRelay<S>
impl<S> Freeze for ConnectUdpMitmRelay<S>where
S: Freeze,
*const [CapsuleType] is !null: Freeze,
PhantomData<[CapsuleType]>: Freeze,
*const ArcInner<Node> is !null: Freeze,
PhantomData<ArcInner<Node>>: Freeze,
*const ArcInner<Composite> is !null: Freeze,
PhantomData<ArcInner<Composite>>: Freeze,
NonZero<u16>: Freeze,
NonZero<usize>: Freeze,
*const ArcInner<dyn ExtensionsTransfer> is !null: Freeze,
PhantomData<ArcInner<dyn ExtensionsTransfer>>: Freeze,
impl<S> Move for ConnectUdpMitmRelay<S>
impl<S> Send for ConnectUdpMitmRelay<S>
impl<S> Sync for ConnectUdpMitmRelay<S>
impl<S> Unpin for ConnectUdpMitmRelay<S>
impl<S> UnsafeUnpin for ConnectUdpMitmRelay<S>where
S: UnsafeUnpin,
*const [CapsuleType] is !null: UnsafeUnpin,
PhantomData<[CapsuleType]>: UnsafeUnpin,
*const ArcInner<Node> is !null: UnsafeUnpin,
PhantomData<ArcInner<Node>>: UnsafeUnpin,
*const ArcInner<Composite> is !null: UnsafeUnpin,
PhantomData<ArcInner<Composite>>: UnsafeUnpin,
NonZeroU16Inner: UnsafeUnpin,
NonZeroUsizeInner: UnsafeUnpin,
*const ArcInner<dyn ExtensionsTransfer> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ExtensionsTransfer>>: UnsafeUnpin,
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<Io, S> MakeMockServer<Io, ServerClone> for S
impl<Io, S> MakeMockServer<Io, ServerClone> for S
type Server = S
fn make_server(&self, _: &ConnectRequest) -> S
§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