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 Ord for MqttString
impl Ord for MqttString
Source§fn cmp(&self, other: &MqttString) -> Ordering
fn cmp(&self, other: &MqttString) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for MqttString
impl PartialEq for MqttString
Source§impl PartialOrd for MqttString
impl PartialOrd 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§
§impl<T> AsUncased for T
impl<T> AsUncased for T
§fn as_uncased(&self) -> &UncasedStr
fn as_uncased(&self) -> &UncasedStr
Convert
self to an [UncasedStr].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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more