[−][src]Struct webthing::property::BaseProperty
Basic property implementation.
A Property represents an individual state value of a thing.
This can easily be used by other properties to handle most of the boring work.
Implementations
impl BaseProperty
[src]
pub fn new(
name: String,
initial_value: Value,
value_forwarder: Option<Box<dyn ValueForwarder>>,
metadata: Option<Map<String, Value>>
) -> BaseProperty
[src]
name: String,
initial_value: Value,
value_forwarder: Option<Box<dyn ValueForwarder>>,
metadata: Option<Map<String, Value>>
) -> BaseProperty
Create a new BaseProperty.
Arguments
name
- name of the propertyinitial_value
- initial property valuevalue_forwarder
- optional value forwarder; property will be read-only if Nonemetadata
- property metadata, i.e. type, description, unit, etc., as a JSON map
Trait Implementations
impl Property for BaseProperty
[src]
fn set_href_prefix(&mut self, prefix: String)
[src]
Set the prefix of any hrefs associated with this property.
fn get_href(&self) -> String
[src]
Get the href of this property.
fn get_value(&self) -> Value
[src]
Get the current property value.
fn set_value(&mut self, value: Value) -> Result<(), &'static str>
[src]
Set the current value of the property.
fn set_cached_value(&mut self, value: Value) -> Result<(), &'static str>
[src]
Set the cached value of the property.
fn get_name(&self) -> String
[src]
Get the name of this property.
fn get_metadata(&self) -> Map<String, Value>
[src]
Get the metadata associated with this property.
fn validate_value(&self, value: &Value) -> Result<(), &'static str>
[src]
fn as_property_description(&self) -> Map<String, Value>
[src]
Auto Trait Implementations
impl !RefUnwindSafe for BaseProperty
impl Send for BaseProperty
impl Sync for BaseProperty
impl Unpin for BaseProperty
impl !UnwindSafe for BaseProperty
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T> GetTypeId for T where
T: Any,
[src]
T: Any,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,