Struct ProxyPathTemplate
pub struct ProxyPathTemplate { /* private fields */ }net only.Expand description
The path-and-query URI Template of a proxy.
It locates the tunnels on the proxy: scheme, host, port and credentials come from
the ProxyAddress carrying it. Its variables say which protocol, see
ProxyPathProtocolTemplate.
The template is validated on construction: a level 3 or lower template whose path
starts with / and using only simple ({x}) and form-style query ({?x}, {&x})
expressions. Other variables are allowed and expand empty. Cloning is cheap.
The syntax is RFC 6570 (UriTemplate), not PathPattern route syntax.
Implementations§
§impl ProxyPathTemplate
impl ProxyPathTemplate
pub const CONNECT_UDP_DEFAULT: &'static str = "/.well-known/masque/udp/{target_host}/{target_port}/"
pub const CONNECT_UDP_DEFAULT: &'static str = "/.well-known/masque/udp/{target_host}/{target_port}/"
The default CONNECT-UDP template a proxy serves (RFC 9298 §2).
pub const CONNECT_IP_DEFAULT: &'static str = "/.well-known/masque/ip/{target}/{ipproto}/"
pub const CONNECT_IP_DEFAULT: &'static str = "/.well-known/masque/ip/{target}/{ipproto}/"
The default CONNECT-IP template a proxy serves (RFC 9484 §3).
pub fn try_new(
template: impl AsRef<str>,
) -> Result<ProxyPathTemplate, ProxyPathTemplateError>
pub fn try_new( template: impl AsRef<str>, ) -> Result<ProxyPathTemplate, ProxyPathTemplateError>
Parse and validate a path-and-query template.
pub fn connect_udp_default() -> ProxyPathTemplate
pub fn connect_udp_default() -> ProxyPathTemplate
The RFC 9298 default CONNECT-UDP template, parsed once.
pub fn connect_ip_default() -> ProxyPathTemplate
pub fn connect_ip_default() -> ProxyPathTemplate
The RFC 9484 default CONNECT-IP template, parsed once.
pub fn is_connect_udp_default(&self) -> bool
pub fn is_connect_udp_default(&self) -> bool
Whether this is the RFC 9298 default CONNECT-UDP template.
pub fn is_connect_ip_default(&self) -> bool
pub fn is_connect_ip_default(&self) -> bool
Whether this is the RFC 9484 default CONNECT-IP template.
pub fn protocol(&self) -> ProxyPathProtocolTemplate
pub fn is_connect_udp(&self) -> bool
pub fn is_connect_ip(&self) -> bool
pub fn template(&self) -> &UriTemplate
pub fn template(&self) -> &UriTemplate
The underlying URI Template.
pub fn expand_target_to(&self, out: &mut String, host: &Host, port: u16)
pub fn expand_target_to(&self, out: &mut String, host: &Host, port: u16)
Append the CONNECT-UDP path and query for a target, leaving other variables empty.
A CONNECT-IP template expands with every variable empty.
pub fn expand_connect_udp_default_to(out: &mut String, host: &Host, port: u16)
pub fn expand_connect_udp_default_to(out: &mut String, host: &Host, port: u16)
Append the default CONNECT-UDP path for a target without parsing a template.
Trait Implementations§
§impl Clone for ProxyPathTemplate
impl Clone for ProxyPathTemplate
§fn clone(&self) -> ProxyPathTemplate
fn clone(&self) -> ProxyPathTemplate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ProxyPathTemplate
impl Debug for ProxyPathTemplate
§impl<'de> Deserialize<'de> for ProxyPathTemplate
impl<'de> Deserialize<'de> for ProxyPathTemplate
§fn deserialize<D>(
deserializer: D,
) -> Result<ProxyPathTemplate, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ProxyPathTemplate, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl Display for ProxyPathTemplate
impl Display for ProxyPathTemplate
impl Eq for ProxyPathTemplate
§impl FromStr for ProxyPathTemplate
impl FromStr for ProxyPathTemplate
§type Err = ProxyPathTemplateError
type Err = ProxyPathTemplateError
§fn from_str(
s: &str,
) -> Result<ProxyPathTemplate, <ProxyPathTemplate as FromStr>::Err>
fn from_str( s: &str, ) -> Result<ProxyPathTemplate, <ProxyPathTemplate as FromStr>::Err>
s to return a value of this type. Read more§impl Hash for ProxyPathTemplate
impl Hash for ProxyPathTemplate
§impl PartialEq for ProxyPathTemplate
impl PartialEq for ProxyPathTemplate
§impl Serialize for ProxyPathTemplate
impl Serialize for ProxyPathTemplate
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl StructuralPartialEq for ProxyPathTemplate
Auto Trait Implementations§
impl Forget for ProxyPathTemplate
impl Freeze for ProxyPathTemplate
impl Move for ProxyPathTemplate
impl RefUnwindSafe for ProxyPathTemplate
impl Send for ProxyPathTemplate
impl Sync for ProxyPathTemplate
impl Unpin for ProxyPathTemplate
impl UnsafeUnpin for ProxyPathTemplate
impl UnwindSafe for ProxyPathTemplatewhere
Arc<Inner>: 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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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§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<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.