Struct MqttString
pub struct MqttString(Box<str>);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§
Source§impl MqttString
impl MqttString
Methods from Deref<Target = MqttStr>§
pub const EMPTY: &'static MqttStr
Sourcepub fn as_mqtt_bytes(&self) -> &MqttBytes
pub fn as_mqtt_bytes(&self) -> &MqttBytes
Returns this string as MqttBytes.
Sourcepub fn encoded_len(&self) -> usize
pub fn encoded_len(&self) -> usize
Returns the number of bytes needed to encode this value.
Trait Implementations§
Source§impl AsRef<MqttStr> for MqttString
impl AsRef<MqttStr> for MqttString
Source§impl AsRef<str> for MqttString
impl AsRef<str> for MqttString
Source§impl Borrow<MqttStr> for MqttString
impl Borrow<MqttStr> for MqttString
Source§impl Clone for MqttString
impl Clone for MqttString
Source§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 moreSource§impl Debug for MqttString
impl Debug for MqttString
Source§impl Deref for MqttString
impl Deref for MqttString
Source§impl Display for MqttString
impl Display for MqttString
Source§impl FromStr for MqttString
impl FromStr for MqttString
Source§impl Hash for MqttString
impl Hash for MqttString
Source§impl PartialEq for MqttString
impl PartialEq for MqttString
Source§impl TryFrom<&str> for MqttString
impl TryFrom<&str> for MqttString
Source§impl TryFrom<MqttString> for TopicBuf
impl TryFrom<MqttString> for TopicBuf
Source§type Error = TopicError
type Error = TopicError
The type returned in the event of a conversion error.
Source§fn try_from(
value: MqttString,
) -> Result<TopicBuf, <TopicBuf as TryFrom<MqttString>>::Error>
fn try_from( value: MqttString, ) -> Result<TopicBuf, <TopicBuf as TryFrom<MqttString>>::Error>
Performs the conversion.
Source§impl TryFrom<MqttString> for TopicFilterBuf
impl TryFrom<MqttString> for TopicFilterBuf
Source§type Error = TopicError
type Error = TopicError
The type returned in the event of a conversion error.
Source§fn try_from(
value: MqttString,
) -> Result<TopicFilterBuf, <TopicFilterBuf as TryFrom<MqttString>>::Error>
fn try_from( value: MqttString, ) -> Result<TopicFilterBuf, <TopicFilterBuf as TryFrom<MqttString>>::Error>
Performs the conversion.
Source§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