#[non_exhaustive]pub struct Match {
pub pattern: &'static str,
pub resource: &'static str,
pub operations: BTreeMap<String, &'static str>,
pub params: Vec<(&'static str, String)>,
}Expand description
What a recognized path refers to.
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.pattern: &'static strThe path template the path matched: /boxes/{boxId}/groups/{groupId}.
resource: &'static strThe part of HEY the path belongs to, as the model titles it: Boxes.
operations: BTreeMap<String, &'static str>The operations served on this path, by method.
params: Vec<(&'static str, String)>The path parameters in the order they appear.
Implementations§
Source§impl Match
impl Match
Sourcepub fn operation(&self) -> &'static str
pub fn operation(&self) -> &'static str
The read on this path, or the alphabetically first operation when there is none.
§Panics
When operations is empty. Recognition never produces such a match; only emptying
the field by hand reaches this.
Sourcepub fn resource_id(&self) -> Option<&str>
pub fn resource_id(&self) -> Option<&str>
The last path parameter: the id of the record the path names, if any.
Trait Implementations§
impl Eq for Match
impl StructuralPartialEq for Match
Auto Trait Implementations§
impl Freeze for Match
impl RefUnwindSafe for Match
impl Send for Match
impl Sync for Match
impl Unpin for Match
impl UnsafeUnpin for Match
impl UnwindSafe for Match
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.