Struct MqttString
pub struct MqttString(Box<str>);Available on crate feature
alloc only.Expand description
An owned UTF-8 string that satisfies all MQTT v5 requirements.
This is the owned counterpart to MqttStr.
Tuple Fields§
§0: Box<str>Implementations§
§impl MqttString
impl MqttString
pub const fn as_mqtt_str(&self) -> &MqttStr
pub const fn as_mqtt_str(&self) -> &MqttStr
Returns a borrowed reference to the underlying MqttStr.
Methods from Deref<Target = MqttStr>§
pub const EMPTY: &'static Self
pub fn as_mqtt_bytes(&self) -> &MqttBytes
pub fn as_mqtt_bytes(&self) -> &MqttBytes
Returns this string as MqttBytes.
pub fn encoded_len(&self) -> usize
pub fn encoded_len(&self) -> usize
Returns the number of bytes needed to encode this value.
Trait Implementations§
§impl AsRef<MqttStr> for MqttString
impl AsRef<MqttStr> for MqttString
§impl AsRef<str> for MqttString
impl AsRef<str> for MqttString
§impl Borrow<MqttStr> for MqttString
impl Borrow<MqttStr> for MqttString
§impl Clone for MqttString
impl Clone for MqttString
§fn clone(&self) -> MqttString
fn clone(&self) -> MqttString
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 Debug for MqttString
impl Debug for MqttString
§impl Deref for MqttString
impl Deref for MqttString
§impl Display for MqttString
impl Display for MqttString
§impl FromStr for MqttString
impl FromStr for MqttString
§impl Hash for MqttString
impl Hash for MqttString
§impl PartialEq for MqttString
impl PartialEq for MqttString
§impl TryFrom<&str> for MqttString
impl TryFrom<&str> for MqttString
§impl TryFrom<Box<str>> for MqttString
impl TryFrom<Box<str>> for MqttString
§impl TryFrom<MqttString> for TopicBuf
impl TryFrom<MqttString> for TopicBuf
§type Error = TopicError
type Error = TopicError
The type returned in the event of a conversion error.
§fn try_from(value: MqttString) -> Result<Self, Self::Error>
fn try_from(value: MqttString) -> Result<Self, Self::Error>
Performs the conversion.
§impl TryFrom<MqttString> for TopicFilterBuf
impl TryFrom<MqttString> for TopicFilterBuf
§type Error = TopicError
type Error = TopicError
The type returned in the event of a conversion error.
§fn try_from(value: MqttString) -> Result<Self, Self::Error>
fn try_from(value: MqttString) -> Result<Self, Self::Error>
Performs the conversion.
§impl TryFrom<String> for MqttString
impl TryFrom<String> for MqttString
impl Eq for MqttString
impl StructuralPartialEq for MqttString
Auto Trait Implementations§
impl Freeze for MqttString
impl RefUnwindSafe for MqttString
impl Send for MqttString
impl Sync for MqttString
impl Unpin for MqttString
impl UnwindSafe for MqttString
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