#[non_exhaustive]pub struct MethodPolicy {
pub selector: String,
pub request_policies: Vec<FieldPolicy>,
/* private fields */
}
Expand description
Defines policies applying to an RPC method.
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.selector: String
Selects a method to which these policies should be enforced, for example, “google.pubsub.v1.Subscriber.CreateSubscription”.
Refer to selector for syntax details.
NOTE: This field must not be set in the proto annotation. It will be automatically filled by the service config compiler .
request_policies: Vec<FieldPolicy>
Policies that are applicable to the request message.
Implementations§
Source§impl MethodPolicy
impl MethodPolicy
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_request_policies<T, V>(self, v: T) -> Self
pub fn set_request_policies<T, V>(self, v: T) -> Self
Sets the value of request_policies.
Trait Implementations§
Source§impl Clone for MethodPolicy
impl Clone for MethodPolicy
Source§fn clone(&self) -> MethodPolicy
fn clone(&self) -> MethodPolicy
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MethodPolicy
impl Debug for MethodPolicy
Source§impl Default for MethodPolicy
impl Default for MethodPolicy
Source§fn default() -> MethodPolicy
fn default() -> MethodPolicy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for MethodPolicywhere
MethodPolicy: Default,
impl<'de> Deserialize<'de> for MethodPolicywhere
MethodPolicy: Default,
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Message for MethodPolicy
impl Message for MethodPolicy
Source§impl PartialEq for MethodPolicy
impl PartialEq for MethodPolicy
Source§impl Serialize for MethodPolicy
impl Serialize for MethodPolicy
impl StructuralPartialEq for MethodPolicy
Auto Trait Implementations§
impl Freeze for MethodPolicy
impl RefUnwindSafe for MethodPolicy
impl Send for MethodPolicy
impl Sync for MethodPolicy
impl Unpin for MethodPolicy
impl UnwindSafe for MethodPolicy
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
Mutably borrows from an owned value. Read more