Struct TopicFilter
#[repr(transparent)]pub struct TopicFilter(MqttStr);Expand description
A validated, borrowed MQTT topic filter.
Topic filters are used in SUBSCRIBE / UNSUBSCRIBE packets and may
contain the single-level wildcard + and the multi-level wildcard #.
The filter must not be empty and must satisfy MqttStr constraints.
This is an unsized type like str. Use &TopicFilter for borrowed
references and TopicFilterBuf for owned values.
Tuple Fields§
§0: MqttStrImplementations§
§impl TopicFilter
impl TopicFilter
pub const unsafe fn new_unchecked(s: &MqttStr) -> &Self
pub const unsafe fn new_unchecked(s: &MqttStr) -> &Self
pub const fn new(s: &MqttStr) -> Result<&Self, TopicError>
pub const fn new(s: &MqttStr) -> Result<&Self, TopicError>
Validates and creates a new topic filter from a validated MqttStr.
§Errors
Returns TopicError if the string is empty or has invalid wildcard
placement.
pub const fn as_mqtt_str(&self) -> &MqttStr
pub const fn as_mqtt_str(&self) -> &MqttStr
Views the topic filter as an MqttStr.
Trait Implementations§
§impl AsRef<MqttStr> for TopicFilter
impl AsRef<MqttStr> for TopicFilter
§impl AsRef<TopicFilter> for TopicFilterBuf
Available on crate feature alloc only.
impl AsRef<TopicFilter> for TopicFilterBuf
Available on crate feature
alloc only.§fn as_ref(&self) -> &TopicFilter
fn as_ref(&self) -> &TopicFilter
Converts this type into a shared reference of the (usually inferred) input type.
§impl AsRef<str> for TopicFilter
impl AsRef<str> for TopicFilter
§impl Borrow<TopicFilter> for TopicFilterBuf
Available on crate feature alloc only.
impl Borrow<TopicFilter> for TopicFilterBuf
Available on crate feature
alloc only.§fn borrow(&self) -> &TopicFilter
fn borrow(&self) -> &TopicFilter
Immutably borrows from an owned value. Read more
§impl Debug for TopicFilter
impl Debug for TopicFilter
§impl Display for TopicFilter
impl Display for TopicFilter
§impl<'a> Extend<&'a TopicFilter> for TopicFiltersBuf
Available on crate feature alloc only.
impl<'a> Extend<&'a TopicFilter> for TopicFiltersBuf
Available on crate feature
alloc only.§fn extend<I: IntoIterator<Item = &'a TopicFilter>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = &'a TopicFilter>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
§impl From<&TopicFilter> for Arc<TopicFilter>
Available on crate feature alloc only.
impl From<&TopicFilter> for Arc<TopicFilter>
Available on crate feature
alloc only.§fn from(f: &TopicFilter) -> Self
fn from(f: &TopicFilter) -> Self
Converts to this type from the input type.
§impl From<&TopicFilter> for TopicFilterBuf
Available on crate feature alloc only.
impl From<&TopicFilter> for TopicFilterBuf
Available on crate feature
alloc only.§fn from(value: &TopicFilter) -> Self
fn from(value: &TopicFilter) -> Self
Converts to this type from the input type.
§impl<'a> FromIterator<&'a TopicFilter> for TopicFiltersBuf
Available on crate feature alloc only.
impl<'a> FromIterator<&'a TopicFilter> for TopicFiltersBuf
Available on crate feature
alloc only.§fn from_iter<I: IntoIterator<Item = &'a TopicFilter>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = &'a TopicFilter>>(iter: I) -> Self
Creates a value from an iterator. Read more
§impl Hash for TopicFilter
impl Hash for TopicFilter
§impl Ord for TopicFilter
impl Ord for TopicFilter
§impl PartialEq for TopicFilter
impl PartialEq for TopicFilter
§impl PartialOrd for TopicFilter
impl PartialOrd for TopicFilter
§impl ToOwned for TopicFilter
Available on crate feature alloc only.
impl ToOwned for TopicFilter
Available on crate feature
alloc only.§type Owned = TopicFilterBuf
type Owned = TopicFilterBuf
The resulting type after obtaining ownership.
§fn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::Owned
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more