[−][src]Struct homie_device::Property
A property of a Homie node.
Fields
id: String
name: String
datatype: Datatype
settable: bool
unit: Option<String>
format: Option<String>
Implementations
impl Property
[src]
pub fn new(
id: &str,
name: &str,
datatype: Datatype,
settable: bool,
unit: Option<&str>,
format: Option<&str>
) -> Property
[src]
id: &str,
name: &str,
datatype: Datatype,
settable: bool,
unit: Option<&str>,
format: Option<&str>
) -> Property
Create a new property with the given attributes.
Arguments
id
: The topic ID for the property. This must be unique per node, and follow the Homie ID format.name
: The human-readable name of the property.datatype
: The data type of the property.settable
: Whether the property can be set by the Homie controller. This should be true for properties like the brightness or power state of a light, and false for things like the temperature reading of a sensor.unit
: The unit for the property, if any. This may be one of the recommended units, or any other custom unit.format
: The format for the property, if any. This must be specified if the datatype isEnum
orColor
, and may be specified if the datatype isInteger
orFloat
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Property
impl Send for Property
impl Sync for Property
impl Unpin for Property
impl UnwindSafe for Property
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,