Enum sparkplug_rs::TopicNamespace
source · [−]pub enum TopicNamespace {
SPAV1_0,
SPBV1_0,
}
Expand description
Enumerator for Sparkplugs’s topic namespace.
The MQTT-Representation can be creaed with the ToString::to_string-method.
assert_eq!("spAv1.0".to_string(), TopicNamespace::SPAV1_0.to_string());
assert_eq!("spBv1.0".to_string(), TopicNamespace::SPBV1_0.to_string());
The MQTT-String representation can be parsed with FromStr::from_str.
Examples
assert_eq!(TopicNamespace::from_str("spAv1.0").unwrap(), TopicNamespace::SPAV1_0);
assert!(TopicNamespace::from_str("xyz").is_err());
Variants
SPAV1_0
SPBV1_0
Trait Implementations
sourceimpl Clone for TopicNamespace
impl Clone for TopicNamespace
sourcefn clone(&self) -> TopicNamespace
fn clone(&self) -> TopicNamespace
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TopicNamespace
impl Debug for TopicNamespace
sourceimpl FromStr for TopicNamespace
impl FromStr for TopicNamespace
sourceimpl PartialEq<TopicNamespace> for TopicNamespace
impl PartialEq<TopicNamespace> for TopicNamespace
sourceimpl PartialOrd<TopicNamespace> for TopicNamespace
impl PartialOrd<TopicNamespace> for TopicNamespace
sourcefn partial_cmp(&self, other: &TopicNamespace) -> Option<Ordering>
fn partial_cmp(&self, other: &TopicNamespace) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl ToString for TopicNamespace
impl ToString for TopicNamespace
impl StructuralPartialEq for TopicNamespace
Auto Trait Implementations
impl RefUnwindSafe for TopicNamespace
impl Send for TopicNamespace
impl Sync for TopicNamespace
impl Unpin for TopicNamespace
impl UnwindSafe for TopicNamespace
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more