Struct mqtt::topic_filter::TopicFilter [−][src]
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()));
Methods
impl TopicFilter
[src]
impl TopicFilter
pub fn new<S: Into<String>>(topic: S) -> Result<TopicFilter, TopicFilterError>
[src]
pub fn new<S: Into<String>>(topic: S) -> Result<TopicFilter, TopicFilterError>
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]
pub unsafe fn new_unchecked<S: Into<String>>(topic: S) -> TopicFilter
Creates a new topic filter from string without validation
Methods from Deref<Target = TopicFilterRef>
pub fn get_matcher<'a>(&'a self) -> TopicFilterMatcher<'a>
[src]
pub fn get_matcher<'a>(&'a self) -> TopicFilterMatcher<'a>
Get a matcher
Trait Implementations
impl Debug for TopicFilter
[src]
impl Debug for TopicFilter
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Eq for TopicFilter
[src]
impl Eq for TopicFilter
impl PartialEq for TopicFilter
[src]
impl PartialEq for TopicFilter
fn eq(&self, other: &TopicFilter) -> bool
[src]
fn eq(&self, other: &TopicFilter) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &TopicFilter) -> bool
[src]
fn ne(&self, other: &TopicFilter) -> bool
This method tests for !=
.
impl Clone for TopicFilter
[src]
impl Clone for TopicFilter
fn clone(&self) -> TopicFilter
[src]
fn clone(&self) -> TopicFilter
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Encodable for TopicFilter
[src]
impl Encodable for TopicFilter
type Err = TopicFilterError
fn encode<W: Write>(&self, writer: &mut W) -> Result<(), TopicFilterError>
[src]
fn encode<W: Write>(&self, writer: &mut W) -> Result<(), TopicFilterError>
Encodes to writer
fn encoded_length(&self) -> u32
[src]
fn encoded_length(&self) -> u32
Length of bytes after encoded
impl Decodable for TopicFilter
[src]
impl Decodable for TopicFilter
type Err = TopicFilterError
type Cond = ()
fn decode_with<R: Read>(
reader: &mut R,
_rest: Option<()>
) -> Result<TopicFilter, TopicFilterError>
[src]
fn decode_with<R: Read>(
reader: &mut R,
_rest: Option<()>
) -> Result<TopicFilter, TopicFilterError>
Decodes object with additional data (or hints)
fn decode<R: Read>(reader: &mut R) -> Result<Self, Self::Err>
[src]
fn decode<R: Read>(reader: &mut R) -> Result<Self, Self::Err>
Decodes object from reader
impl Deref for TopicFilter
[src]
impl Deref for TopicFilter
type Target = TopicFilterRef
The resulting type after dereferencing.
fn deref(&self) -> &TopicFilterRef
[src]
fn deref(&self) -> &TopicFilterRef
Dereferences the value.
Auto Trait Implementations
impl Send for TopicFilter
impl Send for TopicFilter
impl Sync for TopicFilter
impl Sync for TopicFilter