pub struct Pattern { /* private fields */ }Expand description
An entity-name pattern. Holds the original pattern string (for
serialization round-tripping and operator-facing diagnostics) plus a
WildMatch matcher pre-compiled at deserialize time so route resolution
doesn’t re-parse the pattern on every request. Custom Serialize /
Deserialize make this transparent to YAML — it serializes as a plain
string, just like the previous String field did.
Glob syntax (via wildmatch):
*matches any sequence of characters (including empty).?matches any single character.
The previous hand-rolled matcher only handled trailing-* correctly:
*suffix patterns silently matched almost nothing, and multi-star
patterns like ** accidentally matched everything. Both shapes are
real security footguns for scope/tool restriction rules — switching to
wildmatch gives us full single-segment glob semantics.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Pattern
impl<'de> Deserialize<'de> for Pattern
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Pattern
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more