Skip to main content

HttpRouteRuleMatch

Struct HttpRouteRuleMatch 

Source
#[non_exhaustive]
pub struct HttpRouteRuleMatch { pub full_path_match: Option<String>, pub header_matches: Vec<HttpHeaderMatch>, pub ignore_case: Option<bool>, pub metadata_filters: Vec<MetadataFilter>, pub path_template_match: Option<String>, pub prefix_match: Option<String>, pub query_parameter_matches: Vec<HttpQueryParameterMatch>, pub regex_match: Option<String>, /* private fields */ }
Available on crate features region-url-maps or url-maps only.
Expand description

HttpRouteRuleMatch specifies a set of criteria for matching requests to an HttpRouteRule. All specified criteria must be satisfied for a match to occur.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§full_path_match: Option<String>

For satisfying the matchRule condition, the path of the request must exactly match the value specified infullPathMatch after removing any query parameters and anchor that may be part of the original URL.

fullPathMatch must be from 1 to 1024 characters.

Only one of prefixMatch, fullPathMatch,regexMatch or path_template_match must be specified.

§header_matches: Vec<HttpHeaderMatch>

Specifies a list of header match criteria, all of which must match corresponding headers in the request.

§ignore_case: Option<bool>

Specifies that prefixMatch and fullPathMatch matches are case sensitive.

The default value is false.

ignoreCase must not be used with regexMatch.

Not supported when the URL map is bound to a target gRPC proxy.

§metadata_filters: Vec<MetadataFilter>

Opaque filter criteria used by the load balancer to restrict routing configuration to a limited set of xDS compliant clients. In their xDS requests to the load balancer, xDS clients present node metadata. When there is a match, the relevant routing configuration is made available to those proxies.

For each metadataFilter in this list, if itsfilterMatchCriteria is set to MATCH_ANY, at least one of thefilterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels provided in the metadata. If multiple metadata filters are specified, all of them need to be satisfied in order to be considered a match.

metadataFilters specified here is applied after those specified in ForwardingRule that refers to theUrlMap this HttpRouteRuleMatch belongs to.

metadataFilters only applies to load balancers that haveloadBalancingScheme set toINTERNAL_SELF_MANAGED.

Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true.

§path_template_match: Option<String>

If specified, this field defines a path template pattern that must match the :path header after the query string is removed.

A path template pattern can include variables and wildcards. Variables are enclosed in curly braces, for example{variable_name}. Wildcards include * that matches a single path segment, and ** that matches zero or more path segments. The pattern must follow these rules:

  - The value must be between 1 and 1024 characters.
  - The pattern must start with a leading slash ("/").
  - No more than 5 operators (variables or wildcards) may appear in
  the pattern.

Precisely one ofprefixMatch, fullPathMatch,regexMatch, or pathTemplateMatch must be set.

§prefix_match: Option<String>

For satisfying the matchRule condition, the request’s path must begin with the specified prefixMatch.prefixMatch must begin with a /.

The value must be from 1 to 1024 characters.

The * character inside a prefix match is treated as a literal character, not as a wildcard.

Only one of prefixMatch, fullPathMatch,regexMatch or path_template_match can be used within a matchRule.

§query_parameter_matches: Vec<HttpQueryParameterMatch>

Specifies a list of query parameter match criteria, all of which must match corresponding query parameters in the request.

Not supported when the URL map is bound to a target gRPC proxy.

§regex_match: Option<String>

For satisfying the matchRule condition, the path of the request must satisfy the regular expression specified inregexMatch after removing any query parameters and anchor supplied with the original URL. For more information about regular expression syntax, see Syntax.

Only one of prefixMatch, fullPathMatch,regexMatch or path_template_match must be specified.

Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED, EXTERNAL_MANAGED (regional scope) or INTERNAL_MANAGED.

Implementations§

Source§

impl HttpRouteRuleMatch

Source

pub fn new() -> Self

Source

pub fn set_full_path_match<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of full_path_match.

§Example
let x = HttpRouteRuleMatch::new().set_full_path_match("example");
Source

pub fn set_or_clear_full_path_match<T>(self, v: Option<T>) -> Self
where T: Into<String>,

Sets or clears the value of full_path_match.

§Example
let x = HttpRouteRuleMatch::new().set_or_clear_full_path_match(Some("example"));
let x = HttpRouteRuleMatch::new().set_or_clear_full_path_match(None::<String>);
Source

pub fn set_header_matches<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<HttpHeaderMatch>,

Sets the value of header_matches.

§Example
use google_cloud_compute_v1::model::HttpHeaderMatch;
let x = HttpRouteRuleMatch::new()
    .set_header_matches([
        HttpHeaderMatch::default()/* use setters */,
        HttpHeaderMatch::default()/* use (different) setters */,
    ]);
Source

pub fn set_ignore_case<T>(self, v: T) -> Self
where T: Into<bool>,

Sets the value of ignore_case.

§Example
let x = HttpRouteRuleMatch::new().set_ignore_case(true);
Source

pub fn set_or_clear_ignore_case<T>(self, v: Option<T>) -> Self
where T: Into<bool>,

Sets or clears the value of ignore_case.

§Example
let x = HttpRouteRuleMatch::new().set_or_clear_ignore_case(Some(false));
let x = HttpRouteRuleMatch::new().set_or_clear_ignore_case(None::<bool>);
Source

pub fn set_metadata_filters<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<MetadataFilter>,

Sets the value of metadata_filters.

§Example
use google_cloud_compute_v1::model::MetadataFilter;
let x = HttpRouteRuleMatch::new()
    .set_metadata_filters([
        MetadataFilter::default()/* use setters */,
        MetadataFilter::default()/* use (different) setters */,
    ]);
Source

pub fn set_path_template_match<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of path_template_match.

§Example
let x = HttpRouteRuleMatch::new().set_path_template_match("example");
Source

pub fn set_or_clear_path_template_match<T>(self, v: Option<T>) -> Self
where T: Into<String>,

Sets or clears the value of path_template_match.

§Example
let x = HttpRouteRuleMatch::new().set_or_clear_path_template_match(Some("example"));
let x = HttpRouteRuleMatch::new().set_or_clear_path_template_match(None::<String>);
Source

pub fn set_prefix_match<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of prefix_match.

§Example
let x = HttpRouteRuleMatch::new().set_prefix_match("example");
Source

pub fn set_or_clear_prefix_match<T>(self, v: Option<T>) -> Self
where T: Into<String>,

Sets or clears the value of prefix_match.

§Example
let x = HttpRouteRuleMatch::new().set_or_clear_prefix_match(Some("example"));
let x = HttpRouteRuleMatch::new().set_or_clear_prefix_match(None::<String>);
Source

pub fn set_query_parameter_matches<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<HttpQueryParameterMatch>,

Sets the value of query_parameter_matches.

§Example
use google_cloud_compute_v1::model::HttpQueryParameterMatch;
let x = HttpRouteRuleMatch::new()
    .set_query_parameter_matches([
        HttpQueryParameterMatch::default()/* use setters */,
        HttpQueryParameterMatch::default()/* use (different) setters */,
    ]);
Source

pub fn set_regex_match<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of regex_match.

§Example
let x = HttpRouteRuleMatch::new().set_regex_match("example");
Source

pub fn set_or_clear_regex_match<T>(self, v: Option<T>) -> Self
where T: Into<String>,

Sets or clears the value of regex_match.

§Example
let x = HttpRouteRuleMatch::new().set_or_clear_regex_match(Some("example"));
let x = HttpRouteRuleMatch::new().set_or_clear_regex_match(None::<String>);

Trait Implementations§

Source§

impl Clone for HttpRouteRuleMatch

Source§

fn clone(&self) -> HttpRouteRuleMatch

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HttpRouteRuleMatch

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for HttpRouteRuleMatch

Source§

fn default() -> HttpRouteRuleMatch

Returns the “default value” for a type. Read more
Source§

impl Message for HttpRouteRuleMatch

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for HttpRouteRuleMatch

Source§

fn eq(&self, other: &HttpRouteRuleMatch) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for HttpRouteRuleMatch

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,