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>
Validate and create 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 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 Hash for TopicFilter
impl Hash for TopicFilter
§impl PartialEq for TopicFilter
impl PartialEq 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