[−][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]
fn clone(&self) -> TopicFilter
[src]
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 = ()
fn decode_with<R: Read>(
reader: &mut R,
_rest: Option<()>
) -> Result<TopicFilter, TopicFilterError>
[src]
reader: &mut R,
_rest: Option<()>
) -> Result<TopicFilter, TopicFilterError>
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.
fn deref(&self) -> &TopicFilterRef
[src]
impl Encodable for TopicFilter
[src]
type Err = TopicFilterError
fn encode<W: Write>(&self, writer: &mut W) -> Result<(), TopicFilterError>
[src]
fn encoded_length(&self) -> u32
[src]
impl Eq for TopicFilter
[src]
impl From<TopicFilter> for String
[src]
fn from(topic: TopicFilter) -> String
[src]
impl Hash for TopicFilter
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for TopicFilter
[src]
fn cmp(&self, other: &TopicFilter) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<TopicFilter> for TopicFilter
[src]
fn eq(&self, other: &TopicFilter) -> bool
[src]
fn ne(&self, other: &TopicFilter) -> bool
[src]
impl PartialOrd<TopicFilter> for TopicFilter
[src]
fn partial_cmp(&self, other: &TopicFilter) -> Option<Ordering>
[src]
fn lt(&self, other: &TopicFilter) -> bool
[src]
fn le(&self, other: &TopicFilter) -> bool
[src]
fn gt(&self, other: &TopicFilter) -> bool
[src]
fn ge(&self, other: &TopicFilter) -> bool
[src]
impl StructuralEq for TopicFilter
[src]
impl StructuralPartialEq for TopicFilter
[src]
Auto Trait Implementations
impl RefUnwindSafe for TopicFilter
impl Send for TopicFilter
impl Sync for TopicFilter
impl Unpin for TopicFilter
impl UnwindSafe for TopicFilter
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Decodable for T where
T: 'static + Packet + Debug,
[src]
T: 'static + Packet + Debug,
type Err = PacketError<T>
type Cond = FixedHeader
fn decode_with<R>(&mut R, Option<FixedHeader>) -> Result<T, PacketError<T>> where
R: Read,
[src]
R: Read,
fn decode<R: Read>(reader: &mut R) -> Result<Self, Self::Err>
[src]
impl<T> Encodable for T where
T: 'static + Packet + Debug,
[src]
T: 'static + Packet + Debug,
type Err = PacketError<T>
fn encode<W>(&Self, &mut W) -> Result<(), PacketError<T>> where
W: Write,
[src]
W: Write,
fn encoded_length(&Self) -> u32
[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.
fn to_owned(&self) -> T
[src]
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.
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>,