pub struct Attr<M: Model> { /* private fields */ }Expand description
An attribute of a single device, together with the last value written to it, which
Tango keeps aside from the model, and its configuration on that device. Its definition
is shared the way that of a [Command] is.
Implementations§
Source§impl<M: Model> Attr<M>
impl<M: Model> Attr<M>
Sourcepub fn config(&self) -> AttrConfig
pub fn config(&self) -> AttrConfig
The configuration of that attribute on its device.
Sourcepub fn is_memorized(&self) -> bool
pub fn is_memorized(&self) -> bool
Whether that attribute is memorized, see AttrMemorized.
Sourcepub fn info(&self) -> Result<AttrInfo>
pub fn info(&self) -> Result<AttrInfo>
What a client is told of that attribute: what it may read and change of its configuration, and what its definition advertises of its data.
A definition advertising neither a kind nor a format, which only one built out of a raw handler and given neither can be, has nothing to tell a client of its data and is answered with an error rather than with a guess.
An attribute whose configuration could not be applied is described all the same, with what could be, so that a client can still see what it is configured with.
TODO: AttrMode::ReadWithWrite cannot be derived from the handlers, the write
attribute it is paired with having to be named; it needs its own definition.