Struct ConnectIpService
pub struct ConnectIpService<A, H, R = GlobalDnsResolver, L = TunnelLimits> { /* private fields */ }masque only.Expand description
A Rama CONNECT-IP proxy service, independent of the platform packet interface.
A authorizes each request and returns local packet permissions/configuration.
H handles the accepted packet/control session (e.g. an in-memory packet
endpoint or an application packet adapter). Authentication can be layered before
this service; admission must inspect the resulting request identity.
The service requires rama_tls::SecureTransport from a trusted TLS listener
(or HTTP/3, whose transport is intrinsically QUIC). Do not synthesize transport
metadata from client headers. A trusted TLS-termination layer may supply this
marker after verifying the upstream transport; this is the same metadata
contract used by Rama HTTP connection services. Admission and DNS run before the success response;
the capacity lease survives until the handler or its task ends.
Implementations§
§impl<A, H> ConnectIpService<A, H>
impl<A, H> ConnectIpService<A, H>
pub fn new(
template: ConnectIpTemplate,
admission: A,
handler: H,
exec: Executor,
) -> ConnectIpService<A, H>
pub fn new( template: ConnectIpTemplate, admission: A, handler: H, exec: Executor, ) -> ConnectIpService<A, H>
Create a service with optional admission limits and a ten-second deadline covering admission, DNS and upgrade. No forwarding policy is implicit.
§impl<A, H, R, L> ConnectIpService<A, H, R, L>
impl<A, H, R, L> ConnectIpService<A, H, R, L>
pub fn with_limits<L2>(self, limits: L2) -> ConnectIpService<A, H, R, L2>
pub fn with_limits<L2>(self, limits: L2) -> ConnectIpService<A, H, R, L2>
Use shared admission limits, optionally with a custom principal keyer.
pub fn with_open_timeout(
self,
timeout: Duration,
) -> ConnectIpService<A, H, R, L>
pub fn with_open_timeout( self, timeout: Duration, ) -> ConnectIpService<A, H, R, L>
Total opening deadline (zero rejects immediately).
pub fn set_open_timeout(
&mut self,
timeout: Duration,
) -> &mut ConnectIpService<A, H, R, L>
pub fn set_open_timeout( &mut self, timeout: Duration, ) -> &mut ConnectIpService<A, H, R, L>
Total opening deadline (zero rejects immediately).
pub fn maybe_with_proxy_name(
self,
name: Option<Arc<str>>,
) -> ConnectIpService<A, H, R, L>
pub fn maybe_with_proxy_name( self, name: Option<Arc<str>>, ) -> ConnectIpService<A, H, R, L>
Proxy-Status service identifier; defaults to the host addressed by the request.
pub fn maybe_set_proxy_name(
&mut self,
name: Option<Arc<str>>,
) -> &mut ConnectIpService<A, H, R, L>
pub fn maybe_set_proxy_name( &mut self, name: Option<Arc<str>>, ) -> &mut ConnectIpService<A, H, R, L>
Proxy-Status service identifier; defaults to the host addressed by the request.
pub fn with_proxy_name(self, name: Arc<str>) -> ConnectIpService<A, H, R, L>
pub fn with_proxy_name(self, name: Arc<str>) -> ConnectIpService<A, H, R, L>
Proxy-Status service identifier; defaults to the host addressed by the request.
pub fn set_proxy_name(
&mut self,
name: Arc<str>,
) -> &mut ConnectIpService<A, H, R, L>
pub fn set_proxy_name( &mut self, name: Arc<str>, ) -> &mut ConnectIpService<A, H, R, L>
Proxy-Status service identifier; defaults to the host addressed by the request.
pub fn without_proxy_name(self) -> ConnectIpService<A, H, R, L>
pub fn without_proxy_name(self) -> ConnectIpService<A, H, R, L>
Proxy-Status service identifier; defaults to the host addressed by the request.
pub fn unset_proxy_name(&mut self) -> &mut ConnectIpService<A, H, R, L>
pub fn unset_proxy_name(&mut self) -> &mut ConnectIpService<A, H, R, L>
Proxy-Status service identifier; defaults to the host addressed by the request.
pub fn with_resolver<R2>(self, resolver: R2) -> ConnectIpService<A, H, R2, L>
pub fn with_resolver<R2>(self, resolver: R2) -> ConnectIpService<A, H, R2, L>
Use another resolver, e.g. a tenant-aware or deterministic test resolver.
Trait Implementations§
§impl<A, H, R, L> Clone for ConnectIpService<A, H, R, L>where
L: Clone,
impl<A, H, R, L> Clone for ConnectIpService<A, H, R, L>where
L: Clone,
§fn clone(&self) -> ConnectIpService<A, H, R, L>
fn clone(&self) -> ConnectIpService<A, H, R, L>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<A, H, R, L> Debug for ConnectIpService<A, H, R, L>
impl<A, H, R, L> Debug for ConnectIpService<A, H, R, L>
§impl<A, H, R, L, B> Service<Request<B>> for ConnectIpService<A, H, R, L>where
A: Service<ConnectIpRequest<B>, Output = ConnectIpSessionConfig>,
<A as Service<ConnectIpRequest<B>>>::Error: Into<Box<dyn Error + Send + Sync>>,
H: Service<ConnectIpSession, Output = ()>,
<H as Service<ConnectIpSession>>::Error: Into<Box<dyn Error + Send + Sync>>,
R: DnsAddressResolver,
L: AdmitTunnel<Request<B>>,
B: Send + 'static,
impl<A, H, R, L, B> Service<Request<B>> for ConnectIpService<A, H, R, L>where
A: Service<ConnectIpRequest<B>, Output = ConnectIpSessionConfig>,
<A as Service<ConnectIpRequest<B>>>::Error: Into<Box<dyn Error + Send + Sync>>,
H: Service<ConnectIpSession, Output = ()>,
<H as Service<ConnectIpSession>>::Error: Into<Box<dyn Error + Send + Sync>>,
R: DnsAddressResolver,
L: AdmitTunnel<Request<B>>,
B: Send + 'static,
Auto Trait Implementations§
impl<A, H, R = GlobalDnsResolver, L = TunnelLimits> !Freeze for ConnectIpService<A, H, R, L>
impl<A, H, R, L> RefUnwindSafe for ConnectIpService<A, H, R, L>
impl<A, H, R, L> Send for ConnectIpService<A, H, R, L>
impl<A, H, R, L> Sync for ConnectIpService<A, H, R, L>
impl<A, H, R, L> Unpin for ConnectIpService<A, H, R, L>
impl<A, H, R, L> UnsafeUnpin for ConnectIpService<A, H, R, L>
impl<A, H, R, L> UnwindSafe for ConnectIpService<A, H, R, L>
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, ReqBody, ResBody> GrpcService<ReqBody> for T
impl<T, ReqBody, ResBody> GrpcService<ReqBody> for T
§type ResponseBody = ResBody
type ResponseBody = ResBody
§fn serve(
&self,
request: Request<ReqBody>,
) -> impl Future<Output = Result<Response<<T as GrpcService<ReqBody>>::ResponseBody>, <T as GrpcService<ReqBody>>::Error>> + Send
fn serve( &self, request: Request<ReqBody>, ) -> impl Future<Output = Result<Response<<T as GrpcService<ReqBody>>::ResponseBody>, <T as GrpcService<ReqBody>>::Error>> + Send
§impl<S, Body> HttpClientExt for S
impl<S, Body> HttpClientExt for S
§type ExecuteResponse = Response<Body>
type ExecuteResponse = Response<Body>
execute method.§type ExecuteError = <S as Service<Request>>::Error
type ExecuteError = <S as Service<Request>>::Error
execute method.§fn get(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn get( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
GET request to a URL. Read more§fn post(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn post( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
POST request to a URL. Read more§fn put(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn put( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
PUT request to a URL. Read more§fn patch(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn patch( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
PATCH request to a URL. Read more§fn delete(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn delete( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
DELETE request to a URL. Read more§fn head(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn head( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
HEAD request to a URL. Read more§fn connect(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn connect( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
CONNECT request to a URL. Read more§fn query(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn query( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
QUERY request to a URL. Read more§fn request(
&self,
method: Method,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn request( &self, method: Method, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
§fn build_from_request<RequestBody>(
&self,
request: Request<RequestBody>,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn build_from_request<RequestBody>( &self, request: Request<RequestBody>, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
§fn execute(
&self,
request: Request,
) -> impl Future<Output = Result<<S as HttpClientExt>::ExecuteResponse, <S as HttpClientExt>::ExecuteError>>
fn execute( &self, request: Request, ) -> impl Future<Output = Result<<S as HttpClientExt>::ExecuteResponse, <S as HttpClientExt>::ExecuteError>>
Request. Read more§impl<S, Body> HttpClientWebSocketExt<Body> for S
impl<S, Body> HttpClientWebSocketExt<Body> for S
§fn websocket(
&self,
url: impl IntoUrl,
) -> WebSocketRequestBuilder<WithService<'_, S, Body>>
fn websocket( &self, url: impl IntoUrl, ) -> WebSocketRequestBuilder<WithService<'_, S, Body>>
WebSocketRequestBuilder] to be used to establish a WebSocket connection over http/1.1.§fn websocket_h2(
&self,
url: impl IntoUrl,
) -> WebSocketRequestBuilder<WithService<'_, S, Body>>
fn websocket_h2( &self, url: impl IntoUrl, ) -> WebSocketRequestBuilder<WithService<'_, S, Body>>
WebSocketRequestBuilder to be used to establish a WebSocket connection over h2.§fn websocket_h3(
&self,
url: impl IntoUrl,
) -> WebSocketRequestBuilder<WithService<'_, S, Body>>
fn websocket_h3( &self, url: impl IntoUrl, ) -> WebSocketRequestBuilder<WithService<'_, S, Body>>
WebSocketRequestBuilder to be used to establish a WebSocket connection over h3.§fn websocket_with_request<RequestBody>(
&self,
req: Request<RequestBody>,
) -> WebSocketRequestBuilder<WithService<'_, S, Body>>
fn websocket_with_request<RequestBody>( &self, req: Request<RequestBody>, ) -> WebSocketRequestBuilder<WithService<'_, S, Body>>
WebSocketRequestBuilder starting from the given request. Read more§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<S> IntoEndpointService<(S,)> for S
impl<S> IntoEndpointService<(S,)> for S
type Service = S
§fn into_endpoint_service(self) -> <S as IntoEndpointService<(S,)>>::Service
fn into_endpoint_service(self) -> <S as IntoEndpointService<(S,)>>::Service
rama_core::Service.§impl<S, State> IntoEndpointServiceWithState<(S,), State> for S
impl<S, State> IntoEndpointServiceWithState<(S,), State> for S
type Service = S
§fn into_endpoint_service_with_state(
self,
_state: State,
) -> <S as IntoEndpointServiceWithState<(S,), State>>::Service
fn into_endpoint_service_with_state( self, _state: State, ) -> <S as IntoEndpointServiceWithState<(S,), State>>::Service
rama_core::Service with state.§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