[][src]Struct mqtt::topic_filter::TopicFilter

pub struct 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]

impl Debug for TopicFilter[src]

impl Decodable for TopicFilter[src]

type Err = TopicFilterError

type Cond = ()

impl Deref for TopicFilter[src]

type Target = TopicFilterRef

The resulting type after dereferencing.

impl Encodable for TopicFilter[src]

type Err = TopicFilterError

impl Eq for TopicFilter[src]

impl From<TopicFilter> for String[src]

impl Hash for TopicFilter[src]

impl Ord for TopicFilter[src]

impl PartialEq<TopicFilter> for TopicFilter[src]

impl PartialOrd<TopicFilter> for TopicFilter[src]

impl StructuralEq for TopicFilter[src]

impl StructuralPartialEq for TopicFilter[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Decodable for T where
    T: 'static + Packet + Debug
[src]

type Err = PacketError<T>

type Cond = FixedHeader

impl<T> Encodable for T where
    T: 'static + Packet + Debug
[src]

type Err = PacketError<T>

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.