pub enum DeviceMessageType {
DBIRTH,
DDEATH,
DDATA,
DCMD,
}
Expand description
Enum for device-message types.
The string representation for use in MQTT’s topic name can produced by ToString::to_string
§Examples
assert_eq!(DeviceMessageType::DBIRTH.to_string(), "DBIRTH".to_string());
For conversion from the MQTT’s topic representation use FromStr::from_str
§Examples
assert_eq!(DeviceMessageType::from_str("DBIRTH").unwrap(), DeviceMessageType::DBIRTH);
assert!(DeviceMessageType::from_str("xyz").is_err());
Variants§
Trait Implementations§
Source§impl Clone for DeviceMessageType
impl Clone for DeviceMessageType
Source§fn clone(&self) -> DeviceMessageType
fn clone(&self) -> DeviceMessageType
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 DeviceMessageType
impl Debug for DeviceMessageType
Source§impl FromStr for DeviceMessageType
impl FromStr for DeviceMessageType
Source§impl PartialEq for DeviceMessageType
impl PartialEq for DeviceMessageType
Source§impl ToString for DeviceMessageType
impl ToString for DeviceMessageType
impl StructuralPartialEq for DeviceMessageType
Auto Trait Implementations§
impl Freeze for DeviceMessageType
impl RefUnwindSafe for DeviceMessageType
impl Send for DeviceMessageType
impl Sync for DeviceMessageType
impl Unpin for DeviceMessageType
impl UnwindSafe for DeviceMessageType
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