Enum junction_api::http::PathModifier
source · pub enum PathModifier {
ReplaceFullPath {
replace_full_path: String,
},
ReplacePrefixMatch {
replace_prefix_match: String,
},
}
Expand description
Defines configuration for path modifiers.
Variants§
ReplaceFullPath
Specifies the value with which to replace the full path of a request during a rewrite or redirect.
ReplacePrefixMatch
Specifies the value with which to replace the prefix match of a request during a rewrite or redirect. For example, a request to “/foo/bar” with a prefix match of “/foo” and a ReplacePrefixMatch of “/xyz” would be modified to “/xyz/bar”.
Note that this matches the behavior of the PathPrefix match type. This matches full path
elements. A path element refers to the list of labels in the path split by the /
separator. When specified, a trailing /
is ignored. For example, the paths /abc
,
/abc/
, and /abc/def
would all match the prefix /abc
, but the path /abcd
would not.
ReplacePrefixMatch is only compatible with a PathPrefix
route match::
Request Path | Prefix Match | Replace Prefix | Modified Path
-------------|--------------|----------------|----------
/foo/bar | /foo | /xyz | /xyz/bar
/foo/bar | /foo | /xyz/ | /xyz/bar
/foo/bar | /foo/ | /xyz | /xyz/bar
/foo/bar | /foo/ | /xyz/ | /xyz/bar
/foo | /foo | /xyz | /xyz
/foo/ | /foo | /xyz | /xyz/
/foo/bar | /foo | <empty string> | /bar
/foo/ | /foo | <empty string> | /
/foo | /foo | <empty string> | /
/foo/ | /foo | / | /
/foo | /foo | / | /
Trait Implementations§
source§impl Clone for PathModifier
impl Clone for PathModifier
source§fn clone(&self) -> PathModifier
fn clone(&self) -> PathModifier
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PathModifier
impl Debug for PathModifier
source§impl<'de> Deserialize<'de> for PathModifier
impl<'de> Deserialize<'de> for PathModifier
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for PathModifier
impl PartialEq for PathModifier
source§impl Serialize for PathModifier
impl Serialize for PathModifier
impl StructuralPartialEq for PathModifier
Auto Trait Implementations§
impl Freeze for PathModifier
impl RefUnwindSafe for PathModifier
impl Send for PathModifier
impl Sync for PathModifier
impl Unpin for PathModifier
impl UnwindSafe for PathModifier
Blanket Implementations§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request