pub struct TopicName<'t>(/* private fields */);Expand description
A topic name string for that messages can be published on according to https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901241. Cannot contain wildcard characters.
Examples:
- “sport/tennis/player1”
- “sport/tennis/player1/ranking”
- “sport/tennis/player1/score/wimbledon”
Implementations§
Source§impl<'t> TopicName<'t>
impl<'t> TopicName<'t>
Sourcepub fn new(string: MqttString<'t>) -> Option<Self>
pub fn new(string: MqttString<'t>) -> Option<Self>
Creates a new topic name while checking for correct syntax of the topic name string.
Sourcepub const fn new_unchecked(string: MqttString<'t>) -> Self
pub const fn new_unchecked(string: MqttString<'t>) -> Self
Creates a new topic name without checking for correct syntax of the topic name string.
§Invariants
The syntax of the topic name is valid. For a fallible version, use TopicName::new
§Panics
In debug builds, this function will panic if the syntax of string is incorrect.
Sourcepub const fn as_borrowed(&'t self) -> Self
pub const fn as_borrowed(&'t self) -> Self
Delegates to crate::Bytes::as_borrowed.
Trait Implementations§
Source§impl<'t> AsRef<MqttString<'t>> for TopicName<'t>
impl<'t> AsRef<MqttString<'t>> for TopicName<'t>
Source§fn as_ref(&self) -> &MqttString<'t>
fn as_ref(&self) -> &MqttString<'t>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<'t> From<TopicName<'t>> for MqttString<'t>
impl<'t> From<TopicName<'t>> for MqttString<'t>
Source§impl<'t> From<TopicName<'t>> for TopicFilter<'t>
impl<'t> From<TopicName<'t>> for TopicFilter<'t>
impl<'t> Eq for TopicName<'t>
impl<'t> StructuralPartialEq for TopicName<'t>
Auto Trait Implementations§
impl<'t> Freeze for TopicName<'t>
impl<'t> RefUnwindSafe for TopicName<'t>
impl<'t> Send for TopicName<'t>
impl<'t> Sync for TopicName<'t>
impl<'t> Unpin for TopicName<'t>
impl<'t> UnsafeUnpin for TopicName<'t>
impl<'t> UnwindSafe for TopicName<'t>
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