pub enum Pattern {
Get(String),
Put(String),
Post(String),
Delete(String),
Patch(String),
Custom(CustomHttpPattern),
}
Expand description
Determines the URL pattern is matched by this rules. This pattern can be used with any of the {get|put|post|delete|patch} methods. A custom method can be defined using the ‘custom’ field.
Variants§
Get(String)
Maps to HTTP GET. Used for listing and getting information about resources.
Put(String)
Maps to HTTP PUT. Used for replacing a resource.
Post(String)
Maps to HTTP POST. Used for creating a resource or performing an action.
Delete(String)
Maps to HTTP DELETE. Used for deleting a resource.
Patch(String)
Maps to HTTP PATCH. Used for updating a resource.
Custom(CustomHttpPattern)
The custom pattern is used for specifying an HTTP method that is not
included in the pattern
field, such as HEAD, or “*” to leave the
HTTP method unspecified for this rule. The wild-card rule is useful
for services that provide content to Web (HTML) clients.
Implementations§
source§impl Pattern
impl Pattern
sourcepub fn merge(
field: &mut Option<Pattern>,
tag: u32,
wire_type: WireType,
buf: &mut impl Buf,
ctx: DecodeContext,
) -> Result<(), DecodeError>
pub fn merge( field: &mut Option<Pattern>, tag: u32, wire_type: WireType, buf: &mut impl Buf, ctx: DecodeContext, ) -> Result<(), DecodeError>
Decodes an instance of the message from a buffer, and merges it into self.
sourcepub fn encoded_len(&self) -> usize
pub fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Trait Implementations§
source§impl PartialEq for Pattern
impl PartialEq for Pattern
impl StructuralPartialEq for Pattern
Auto Trait Implementations§
impl Freeze for Pattern
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnwindSafe for Pattern
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