Struct google_api_proto::google::cloud::networkservices::v1::http_route::Redirect
source · pub struct Redirect {
pub host_redirect: String,
pub path_redirect: String,
pub prefix_rewrite: String,
pub response_code: i32,
pub https_redirect: bool,
pub strip_query: bool,
pub port_redirect: i32,
}
Expand description
The specification for redirecting traffic.
Fields§
§host_redirect: String
The host that will be used in the redirect response instead of the one that was supplied in the request.
path_redirect: String
The path that will be used in the redirect response instead of the one that was supplied in the request. path_redirect can not be supplied together with prefix_redirect. Supply one alone or neither. If neither is supplied, the path of the original request will be used for the redirect.
prefix_rewrite: String
Indicates that during redirection, the matched prefix (or path) should be swapped with this value. This option allows URLs be dynamically created based on the request.
response_code: i32
The HTTP Status code to use for the redirect.
https_redirect: bool
If set to true, the URL scheme in the redirected request is set to https. If set to false, the URL scheme of the redirected request will remain the same as that of the request.
The default is set to false.
strip_query: bool
if set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained.
The default is set to false.
port_redirect: i32
The port that will be used in the redirected request instead of the one that was supplied in the request.
Implementations§
source§impl Redirect
impl Redirect
sourcepub fn response_code(&self) -> ResponseCode
pub fn response_code(&self) -> ResponseCode
Returns the enum value of response_code
, or the default if the field is set to an invalid enum value.
sourcepub fn set_response_code(&mut self, value: ResponseCode)
pub fn set_response_code(&mut self, value: ResponseCode)
Sets response_code
to the provided enum value.
Trait Implementations§
source§impl Message for Redirect
impl Message for Redirect
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
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<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
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<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
. Read moresource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
.source§impl PartialEq for Redirect
impl PartialEq for Redirect
impl StructuralPartialEq for Redirect
Auto Trait Implementations§
impl Freeze for Redirect
impl RefUnwindSafe for Redirect
impl Send for Redirect
impl Sync for Redirect
impl Unpin for Redirect
impl UnwindSafe for Redirect
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