#[non_exhaustive]pub struct ContextRule {
pub selector: String,
pub requested: Vec<String>,
pub provided: Vec<String>,
pub allowed_request_extensions: Vec<String>,
pub allowed_response_extensions: Vec<String>,
/* private fields */
}
Expand description
A context rule provides information about the context for an individual API element.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.selector: String
Selects the methods to which this rule applies.
Refer to selector for syntax details.
requested: Vec<String>
A list of full type names of requested contexts, only the requested context will be made available to the backend.
provided: Vec<String>
A list of full type names of provided contexts. It is used to support propagating HTTP headers and ETags from the response extension.
allowed_request_extensions: Vec<String>
A list of full type names or extension IDs of extensions allowed in grpc side channel from client to backend.
allowed_response_extensions: Vec<String>
A list of full type names or extension IDs of extensions allowed in grpc side channel from backend to client.
Implementations§
Source§impl ContextRule
impl ContextRule
pub fn new() -> Self
Sourcepub fn set_selector<T: Into<String>>(self, v: T) -> Self
pub fn set_selector<T: Into<String>>(self, v: T) -> Self
Sets the value of selector.
Sourcepub fn set_requested<T, V>(self, v: T) -> Self
pub fn set_requested<T, V>(self, v: T) -> Self
Sets the value of requested.
Sourcepub fn set_provided<T, V>(self, v: T) -> Self
pub fn set_provided<T, V>(self, v: T) -> Self
Sets the value of provided.
Sourcepub fn set_allowed_request_extensions<T, V>(self, v: T) -> Self
pub fn set_allowed_request_extensions<T, V>(self, v: T) -> Self
Sets the value of allowed_request_extensions.
Sourcepub fn set_allowed_response_extensions<T, V>(self, v: T) -> Self
pub fn set_allowed_response_extensions<T, V>(self, v: T) -> Self
Sets the value of allowed_response_extensions.
Trait Implementations§
Source§impl Clone for ContextRule
impl Clone for ContextRule
Source§fn clone(&self) -> ContextRule
fn clone(&self) -> ContextRule
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more