Struct TopicBuf
pub struct TopicBuf(MqttString);Expand description
An owned, validated MQTT topic name.
This is the owned counterpart to Topic, analogous to
PathBuf -> Path.
Tuple Fields§
§0: MqttStringImplementations§
Methods from Deref<Target = Topic>§
Sourcepub fn as_mqtt_str(&self) -> &MqttStr
pub fn as_mqtt_str(&self) -> &MqttStr
View the topic as an MqttStr.
Sourcepub fn try_to_owned(&self) -> Result<TopicBuf, TryReserveError>
pub fn try_to_owned(&self) -> Result<TopicBuf, TryReserveError>
Copies the topic into a TopicBuf without panicking if the
allocation fails.
§Errors
Returns TryReserveError if the allocation fails.
Trait Implementations§
impl Eq for TopicBuf
impl StructuralPartialEq for TopicBuf
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.
Auto Trait Implementations§
impl Freeze for TopicBuf
impl RefUnwindSafe for TopicBuf
impl Send for TopicBuf
impl Sync for TopicBuf
impl Unpin for TopicBuf
impl UnsafeUnpin for TopicBuf
impl UnwindSafe for TopicBuf
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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