Struct google_api_proto::google::cloud::compute::v1::UrlRewrite
source · pub struct UrlRewrite {
pub host_rewrite: Option<String>,
pub path_prefix_rewrite: Option<String>,
pub path_template_rewrite: Option<String>,
}
Expand description
The spec for modifying the path before sending the request to the matched backend service.
Fields§
§host_rewrite: Option<String>
Before forwarding the request to the selected service, the request’s host header is replaced with contents of hostRewrite. The value must be from 1 to 255 characters.
path_prefix_rewrite: Option<String>
Before forwarding the request to the selected backend service, the matching portion of the request’s path is replaced by pathPrefixRewrite. The value must be from 1 to 1024 characters.
path_template_rewrite: Option<String>
If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax. A corresponding path_template_match must be specified. Any template variables must exist in the path_template_match field. - -At least one variable must be specified in the path_template_match field - You can omit variables from the rewritten URL - The * and ** operators cannot be matched unless they have a corresponding variable name - e.g. {format=*} or {var=}. For example, a path_template_match of /static/{format=} could be rewritten as /static/content/{format} to prefix /content to the URL. Variables can also be re-ordered in a rewrite, so that /{country}/{format}/{suffix=**} can be rewritten as /content/{format}/{country}/{suffix}. At least one non-empty routeRules[].matchRules[].path_template_match is required. Only one of path_prefix_rewrite or path_template_rewrite may be specified.
Implementations§
source§impl UrlRewrite
impl UrlRewrite
sourcepub fn path_prefix_rewrite(&self) -> &str
pub fn path_prefix_rewrite(&self) -> &str
Returns the value of path_prefix_rewrite
, or the default value if path_prefix_rewrite
is unset.
sourcepub fn host_rewrite(&self) -> &str
pub fn host_rewrite(&self) -> &str
Returns the value of host_rewrite
, or the default value if host_rewrite
is unset.
sourcepub fn path_template_rewrite(&self) -> &str
pub fn path_template_rewrite(&self) -> &str
Returns the value of path_template_rewrite
, or the default value if path_template_rewrite
is unset.
Trait Implementations§
source§impl Clone for UrlRewrite
impl Clone for UrlRewrite
source§fn clone(&self) -> UrlRewrite
fn clone(&self) -> UrlRewrite
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for UrlRewrite
impl Debug for UrlRewrite
source§impl Default for UrlRewrite
impl Default for UrlRewrite
source§impl Message for UrlRewrite
impl Message for UrlRewrite
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for UrlRewrite
impl PartialEq for UrlRewrite
source§fn eq(&self, other: &UrlRewrite) -> bool
fn eq(&self, other: &UrlRewrite) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for UrlRewrite
Auto Trait Implementations§
impl Freeze for UrlRewrite
impl RefUnwindSafe for UrlRewrite
impl Send for UrlRewrite
impl Sync for UrlRewrite
impl Unpin for UrlRewrite
impl UnwindSafe for UrlRewrite
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
§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> 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