Struct ConnectUdpConnector
pub struct ConnectUdpConnector<S, C> { /* private fields */ }masque only.Expand description
A datagram proxy connector for MASQUE (RFC 9298): a request on a ProxyRoute to a
MASQUE proxy gets a CONNECT-UDP tunnel to its target, opened with the HTTP client S;
every other request goes to the inner datagram connector C.
The tunnel’s target keeps its name: the proxy resolves it. A request addressed to its own
MASQUE proxy (ProxyRoute::addresses_proxy) goes to C, as does a request without a
proxy route. A proxy route to any other kind of proxy is refused, so it is never bypassed.
A tunnel publishes EstablishedProxyRoute::Tunnel on its socket.
S sends the CONNECT-UDP request to the proxy: it needs proxy support, so the proxy’s
credentials go with it, and, for HTTP/3 datagrams, an outer initial MTU of
OUTER_INITIAL_MTU.
Implementations§
§impl<S, C> ConnectUdpConnector<S, C>
impl<S, C> ConnectUdpConnector<S, C>
pub fn new(inner: C, client: S, exec: Executor) -> ConnectUdpConnector<S, C>
pub fn new(inner: C, client: S, exec: Executor) -> ConnectUdpConnector<S, C>
Tunnel MASQUE routes with client and serve the rest with inner; exec runs each
tunnel’s send task.
pub fn with_version(self, version: Version) -> ConnectUdpConnector<S, C>
pub fn with_version(self, version: Version) -> ConnectUdpConnector<S, C>
The HTTP version of the CONNECT-UDP request to the proxy; HTTP/3 by default.
pub fn set_version(
&mut self,
version: Version,
) -> &mut ConnectUdpConnector<S, C>
pub fn set_version( &mut self, version: Version, ) -> &mut ConnectUdpConnector<S, C>
The HTTP version of the CONNECT-UDP request to the proxy; HTTP/3 by default.
pub fn with_socket_config(
self,
config: ConnectUdpSocketConfig,
) -> ConnectUdpConnector<S, C>
pub fn with_socket_config( self, config: ConnectUdpSocketConfig, ) -> ConnectUdpConnector<S, C>
Limits of each tunnel, including its idle timeout.
pub fn set_socket_config(
&mut self,
config: ConnectUdpSocketConfig,
) -> &mut ConnectUdpConnector<S, C>
pub fn set_socket_config( &mut self, config: ConnectUdpSocketConfig, ) -> &mut ConnectUdpConnector<S, C>
Limits of each tunnel, including its idle timeout.
Trait Implementations§
§impl<S, C> Clone for ConnectUdpConnector<S, C>
impl<S, C> Clone for ConnectUdpConnector<S, C>
§fn clone(&self) -> ConnectUdpConnector<S, C>
fn clone(&self) -> ConnectUdpConnector<S, C>
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, C> Debug for ConnectUdpConnector<S, C>
impl<S, C> Debug for ConnectUdpConnector<S, C>
§impl<S, C> Service<ConnectRequest> for ConnectUdpConnector<S, C>where
S: Service<Request, Output = Response>,
<S as Service<Request>>::Error: Into<Box<dyn Error + Send + Sync>>,
C: ConnectorService<ConnectRequest>,
<C as ConnectorService<ConnectRequest>>::Connection: DatagramSocket,
impl<S, C> Service<ConnectRequest> for ConnectUdpConnector<S, C>where
S: Service<Request, Output = Response>,
<S as Service<Request>>::Error: Into<Box<dyn Error + Send + Sync>>,
C: ConnectorService<ConnectRequest>,
<C as ConnectorService<ConnectRequest>>::Connection: DatagramSocket,
§type Output = EstablishedClientConnection<MaybeTunneledSocket<<C as ConnectorService<ConnectRequest>>::Connection>, ConnectRequest>
type Output = EstablishedClientConnection<MaybeTunneledSocket<<C as ConnectorService<ConnectRequest>>::Connection>, ConnectRequest>
§type Error = ConnectionError
type Error = ConnectionError
§async fn serve(
&self,
input: ConnectRequest,
) -> Result<<ConnectUdpConnector<S, C> as Service<ConnectRequest>>::Output, <ConnectUdpConnector<S, C> as Service<ConnectRequest>>::Error>
async fn serve( &self, input: ConnectRequest, ) -> Result<<ConnectUdpConnector<S, C> as Service<ConnectRequest>>::Output, <ConnectUdpConnector<S, C> as Service<ConnectRequest>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
Auto Trait Implementations§
impl<S, C> Freeze for ConnectUdpConnector<S, C>
impl<S, C> RefUnwindSafe for ConnectUdpConnector<S, C>where
S: RefUnwindSafe,
C: RefUnwindSafe,
impl<S, C> Send for ConnectUdpConnector<S, C>
impl<S, C> Sync for ConnectUdpConnector<S, C>
impl<S, C> Unpin for ConnectUdpConnector<S, C>
impl<S, C> UnsafeUnpin for ConnectUdpConnector<S, C>where
S: UnsafeUnpin,
C: UnsafeUnpin,
impl<S, C> UnwindSafe for ConnectUdpConnector<S, C>where
S: UnwindSafe,
C: UnwindSafe,
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<S, Input, Connection> ConnectorService<Input> for Swhere
S: Service<Input, Output = EstablishedClientConnection<Connection, Input>>,
<S as Service<Input>>::Error: Into<ConnectionError>,
Connection: Send + ExtensionsRef,
impl<S, Input, Connection> ConnectorService<Input> for Swhere
S: Service<Input, Output = EstablishedClientConnection<Connection, Input>>,
<S as Service<Input>>::Error: Into<ConnectionError>,
Connection: Send + ExtensionsRef,
§type Connection = Connection
type Connection = Connection
ConnectorService§fn connect(
&self,
input: Input,
) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<Input>>::Connection, Input>, ConnectionError>> + Send
fn connect( &self, input: Input, ) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<Input>>::Connection, Input>, ConnectionError>> + Send
§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