pub struct TopicMatch { /* private fields */ }Expand description
The result of matching a TopicPath against a pattern.
Holds the matched topic plus the ranges of segments captured by the
pattern’s wildcards, accessible by position (get_param)
or by name (get_named_param).
Implementations§
Source§impl TopicMatch
impl TopicMatch
Sourcepub fn path_segments(&self) -> &Vec<Substr>
pub fn path_segments(&self) -> &Vec<Substr>
Returns the matched topic’s segments.
Sourcepub fn get_param(&self, index: usize) -> Option<Substr>
pub fn get_param(&self, index: usize) -> Option<Substr>
Returns the positional parameter captured at index, if any.
Parameters are numbered in pattern order; a # wildcard yields the
joined remainder of the topic.
Sourcepub fn get_named_param(&self, name: &str) -> Option<Substr>
pub fn get_named_param(&self, name: &str) -> Option<Substr>
Returns the value of the named parameter name, if the pattern bound one.
Sourcepub fn topic_path(&self) -> ArcStr
pub fn topic_path(&self) -> ArcStr
Returns a cheap (refcounted) clone of the matched topic string.
Trait Implementations§
Source§impl Debug for TopicMatch
impl Debug for TopicMatch
Auto Trait Implementations§
impl Freeze for TopicMatch
impl RefUnwindSafe for TopicMatch
impl Send for TopicMatch
impl Sync for TopicMatch
impl Unpin for TopicMatch
impl UnsafeUnpin for TopicMatch
impl UnwindSafe for TopicMatch
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