pub struct Pattern { /* private fields */ }Expand description
A subscription filter that may include wildcards.
Wildcards follow MQTT conventions:
+matches exactly one level#matches the remainder of the topic (including zero levels) and may only appear as the last segment
§Examples
use quill::{Pattern, Topic};
let pat = Pattern::parse("sensors/+/temp").unwrap();
let topic = Topic::parse("sensors/kitchen/temp").unwrap();
assert!(pat.matches(&topic));Implementations§
Source§impl Pattern
impl Pattern
Sourcepub fn parse(input: &str) -> Result<Self, ParseError>
pub fn parse(input: &str) -> Result<Self, ParseError>
Parse input using the default delimiter.
Sourcepub fn parse_with(input: &str, delimiter: char) -> Result<Self, ParseError>
pub fn parse_with(input: &str, delimiter: char) -> Result<Self, ParseError>
Parse input using a custom segment delimiter.
Trait Implementations§
impl Eq for Pattern
impl StructuralPartialEq for Pattern
Auto Trait Implementations§
impl Forget for Pattern
impl Freeze for Pattern
impl Move 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