pub struct TopicFilter { /* private fields */ }
Expand description
Represents an MQTT topic filter
Implementations§
Source§impl TopicFilter
impl TopicFilter
Sourcepub fn from_string(topic_filter: String) -> Result<TopicFilter, TopicParseError>
pub fn from_string(topic_filter: String) -> Result<TopicFilter, TopicParseError>
Create a new TopicFilter
from a String
§Arguments
topic_filter
- The MQTT topic filter
§Errors
TopicParseError
- If the topic filter is invalid for an MQTT topic filter
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Get the TopicFilter
formatted as a &str
Sourcepub fn matches_topic_name(&self, topic_name: &TopicName) -> bool
pub fn matches_topic_name(&self, topic_name: &TopicName) -> bool
Check if the TopicFilter
matches given TopicName
§Arguments
topic_name
- The MQTT topic name to match against
Sourcepub fn is_valid_topic_filter(topic_filter: &str) -> bool
pub fn is_valid_topic_filter(topic_filter: &str) -> bool
Returns true if the MQTT topic filter is valid
§Arguments
topic_filter
- The MQTT topic filter to check validity of
Trait Implementations§
Source§impl Clone for TopicFilter
impl Clone for TopicFilter
Source§fn clone(&self) -> TopicFilter
fn clone(&self) -> TopicFilter
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TopicFilter
impl Debug for TopicFilter
Source§impl Display for TopicFilter
impl Display for TopicFilter
Source§impl FromStr for TopicFilter
impl FromStr for TopicFilter
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Create a new TopicFilter
from a &str
§Arguments
s
- The MQTT topic filter
§Errors
TopicParseError
- If the topic filter is invalid for an MQTT topic filter
Source§type Err = TopicParseError
type Err = TopicParseError
The associated error which can be returned from parsing.
Source§impl Hash for TopicFilter
impl Hash for TopicFilter
Source§impl PartialEq for TopicFilter
impl PartialEq for TopicFilter
impl Eq for TopicFilter
Auto Trait Implementations§
impl Freeze for TopicFilter
impl RefUnwindSafe for TopicFilter
impl Send for TopicFilter
impl Sync for TopicFilter
impl Unpin for TopicFilter
impl UnwindSafe for TopicFilter
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