[−][src]Struct mqtt::topic_filter::TopicFilter
Topic filter
http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718106
use mqtt::{TopicFilter, TopicNameRef}; let topic_filter = TopicFilter::new("sport/+/player1").unwrap(); let matcher = topic_filter.get_matcher(); assert!(matcher.is_match(TopicNameRef::new("sport/abc/player1").unwrap()));
Implementations
impl TopicFilter[src]
pub fn new<S: Into<String>>(topic: S) -> Result<TopicFilter, TopicFilterError>[src]
Creates a new topic filter from string Return error if it is not a valid topic filter
pub unsafe fn new_unchecked<S: Into<String>>(topic: S) -> TopicFilter[src]
Creates a new topic filter from string without validation
Safety
Topic filters' syntax is defined in MQTT specification. Creating a filter from raw string may cause errors
Methods from Deref<Target = TopicFilterRef>
pub fn get_matcher(&self) -> TopicFilterMatcher<'_>[src]
Get a matcher
Trait Implementations
impl Clone for TopicFilter[src]
pub fn clone(&self) -> TopicFilter[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for TopicFilter[src]
impl Decodable for TopicFilter[src]
type Err = TopicFilterError
type Cond = ()
pub fn decode_with<R: Read>(
reader: &mut R,
_rest: Option<()>
) -> Result<TopicFilter, TopicFilterError>[src]
reader: &mut R,
_rest: Option<()>
) -> Result<TopicFilter, TopicFilterError>
pub fn decode<R: Read>(reader: &mut R) -> Result<Self, Self::Err>[src]
impl Deref for TopicFilter[src]
type Target = TopicFilterRef
The resulting type after dereferencing.
pub fn deref(&self) -> &TopicFilterRef[src]
impl Encodable for TopicFilter[src]
type Err = TopicFilterError
pub fn encode<W: Write>(&self, writer: &mut W) -> Result<(), TopicFilterError>[src]
pub fn encoded_length(&self) -> u32[src]
impl Eq for TopicFilter[src]
impl From<TopicFilter> for String[src]
pub fn from(topic: TopicFilter) -> String[src]
impl Hash for TopicFilter[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl Ord for TopicFilter[src]
pub fn cmp(&self, other: &TopicFilter) -> Ordering[src]
#[must_use]pub fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self1.50.0[src]
impl PartialEq<TopicFilter> for TopicFilter[src]
pub fn eq(&self, other: &TopicFilter) -> bool[src]
pub fn ne(&self, other: &TopicFilter) -> bool[src]
impl PartialOrd<TopicFilter> for TopicFilter[src]
pub fn partial_cmp(&self, other: &TopicFilter) -> Option<Ordering>[src]
pub fn lt(&self, other: &TopicFilter) -> bool[src]
pub fn le(&self, other: &TopicFilter) -> bool[src]
pub fn gt(&self, other: &TopicFilter) -> bool[src]
pub fn ge(&self, other: &TopicFilter) -> bool[src]
impl StructuralEq for TopicFilter[src]
impl StructuralPartialEq for TopicFilter[src]
Auto Trait Implementations
impl RefUnwindSafe for TopicFilter[src]
impl Send for TopicFilter[src]
impl Sync for TopicFilter[src]
impl Unpin for TopicFilter[src]
impl UnwindSafe for TopicFilter[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,