Struct TopicFilter
#[repr(transparent)]pub struct TopicFilter<S: ?Sized>(S);Expand description
A MQTT topic filter.
This type works as a wrapper around any AsRef<str> type. Typically used as
either a reference (TopicFilter<str>) or an owned string
(TopicFilter<Box<str>>).
All the interesting methods are implemented on the TopicFilter<str>
variant, but other types automatically deref to it.
Tuple Fields§
§0: SImplementations§
§impl TopicFilter<str>
impl TopicFilter<str>
pub fn to_boxed_str(&self) -> TopicFilter<Box<str>>
pub fn to_boxed_str(&self) -> TopicFilter<Box<str>>
Converts the topic filter reference into an owned version.
pub fn contains_wildcard(&self) -> bool
pub fn contains_wildcard(&self) -> bool
Returns true if the topic filter contains any wildcard characters.
§impl TopicFilter<Box<str>>
impl TopicFilter<Box<str>>
pub const fn to_ref(&self) -> &TopicFilter<str>
pub const fn to_ref(&self) -> &TopicFilter<str>
Converts the owned topic filter into a reference.
§impl<S: AsRef<str>> TopicFilter<S>
impl<S: AsRef<str>> TopicFilter<S>
pub fn new(inner: S) -> Self
pub fn new(inner: S) -> Self
Creates a new topic filter wrapping the given inner type.
pub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Consumes the topic filter and returns the inner type.
Trait Implementations§
§impl<S: ?Sized + AsRef<str>> AsRef<TopicFilter<str>> for TopicFilter<S>
impl<S: ?Sized + AsRef<str>> AsRef<TopicFilter<str>> for TopicFilter<S>
§fn as_ref(&self) -> &TopicFilter<str>
fn as_ref(&self) -> &TopicFilter<str>
Converts this type into a shared reference of the (usually inferred) input type.
§impl Borrow<TopicFilter<str>> for TopicFilter<Box<str>>
impl Borrow<TopicFilter<str>> for TopicFilter<Box<str>>
§fn borrow(&self) -> &TopicFilter<str>
fn borrow(&self) -> &TopicFilter<str>
Immutably borrows from an owned value. Read more
§impl<S: Clone + ?Sized> Clone for TopicFilter<S>
impl<S: Clone + ?Sized> Clone for TopicFilter<S>
§fn clone(&self) -> TopicFilter<S>
fn clone(&self) -> TopicFilter<S>
Returns a duplicate 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 more§impl<S: Debug + ?Sized> Debug for TopicFilter<S>
impl<S: Debug + ?Sized> Debug for TopicFilter<S>
§impl Deref for TopicFilter<Box<str>>
impl Deref for TopicFilter<Box<str>>
§impl<S> Ord for TopicFilter<S>
impl<S> Ord for TopicFilter<S>
§impl<Lhs, Rhs> PartialEq<TopicFilter<Rhs>> for TopicFilter<Lhs>
impl<Lhs, Rhs> PartialEq<TopicFilter<Rhs>> for TopicFilter<Lhs>
§impl<Lhs, Rhs> PartialOrd<TopicFilter<Rhs>> for TopicFilter<Lhs>
impl<Lhs, Rhs> PartialOrd<TopicFilter<Rhs>> for TopicFilter<Lhs>
impl<S: ?Sized + AsRef<str>> Eq for TopicFilter<S>
Auto Trait Implementations§
impl<S> Freeze for TopicFilter<S>
impl<S> RefUnwindSafe for TopicFilter<S>where
S: RefUnwindSafe + ?Sized,
impl<S> Send for TopicFilter<S>
impl<S> Sync for TopicFilter<S>
impl<S> Unpin for TopicFilter<S>
impl<S> UnwindSafe for TopicFilter<S>where
S: UnwindSafe + ?Sized,
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