pub struct ValueFormat<'a> { /* private fields */ }Expand description
Formats the values of one object.
Implementations§
Source§impl ValueFormat<'_>
impl ValueFormat<'_>
Sourcepub fn data(&self, property: PropertyIdentifier, data: &[u8]) -> Datum
pub fn data(&self, property: PropertyIdentifier, data: &[u8]) -> Datum
A property’s value as typed data, decoded as Self::value decodes
it: a constructed value element by element, and otherwise as
application values, one a datum and several a list.
Sourcepub fn data_at(
&self,
property: PropertyIdentifier,
index: Option<u32>,
data: &[u8],
) -> Datum
pub fn data_at( &self, property: PropertyIdentifier, index: Option<u32>, data: &[u8], ) -> Datum
Self::data of a read at an array index, as
Self::value_at reads it.
Sourcepub fn element_data(
&self,
property: PropertyIdentifier,
value: &PropertyValue,
) -> Datum
pub fn element_data( &self, property: PropertyIdentifier, value: &PropertyValue, ) -> Datum
One application value of property as typed data.
Source§impl ValueFormat<'_>
impl ValueFormat<'_>
Sourcepub fn logged(
&self,
column: Option<LoggedProperty>,
value: &PropertyValue,
) -> String
pub fn logged( &self, column: Option<LoggedProperty>, value: &PropertyValue, ) -> String
One logged value as text, named for the property column samples,
and a state by this formatter’s state texts: make it with the
column’s (LogColumns::state_texts).
An enumeration nothing names shows as enum 3, so it isn’t taken
for a count; a bit string nothing names shows as its bits.
A primitive value is named by its property alone, whether the log
samples the whole property or one element of it (a Priority_Array
slot names its state as the property does), so column.index only
matters to the octet forms, which decode one element of a collection.
Sourcepub fn logged_data(
&self,
column: Option<LoggedProperty>,
value: &PropertyValue,
) -> Datum
pub fn logged_data( &self, column: Option<LoggedProperty>, value: &PropertyValue, ) -> Datum
Self::logged as typed data: an enumeration with its name and a
bit string with its set bits’ names, when the property names them.
Sourcepub fn logged_octets(
&self,
column: Option<LoggedProperty>,
octets: &[u8],
) -> String
pub fn logged_octets( &self, column: Option<LoggedProperty>, octets: &[u8], ) -> String
A logged value of another datatype, as its tagged octets, as text:
decoded as a read of the property column samples would be.
Sourcepub fn logged_octets_data(
&self,
column: Option<LoggedProperty>,
octets: &[u8],
) -> Datum
pub fn logged_octets_data( &self, column: Option<LoggedProperty>, octets: &[u8], ) -> Datum
Self::logged_octets as typed data.
Source§impl<'a> ValueFormat<'a>
impl<'a> ValueFormat<'a>
Sourcepub fn new(
object_type: ObjectType,
texts: &'a StateTexts,
floats: Floats,
) -> Self
pub fn new( object_type: ObjectType, texts: &'a StateTexts, floats: Floats, ) -> Self
A formatter for an object of object_type.
Sourcepub fn whole_lists(self) -> Self
pub fn whole_lists(self) -> Self
The same formatter, showing every element of a list instead of the first few and a count.
Sourcepub fn for_object<'b>(
&self,
object_type: ObjectType,
texts: &'b StateTexts,
) -> ValueFormat<'b>
pub fn for_object<'b>( &self, object_type: ObjectType, texts: &'b StateTexts, ) -> ValueFormat<'b>
The same settings for another object, as a value that names one (an action’s target, a group member) needs.
Sourcepub fn constructed_items(
&self,
property: PropertyIdentifier,
data: &[u8],
) -> Option<Vec<String>>
pub fn constructed_items( &self, property: PropertyIdentifier, data: &[u8], ) -> Option<Vec<String>>
The text of each element of a constructed value, when the element
table names the property’s element and the octets decode as those
elements to the end; None otherwise.
Sourcepub fn value(&self, property: PropertyIdentifier, data: &[u8]) -> String
pub fn value(&self, property: PropertyIdentifier, data: &[u8]) -> String
A property’s value as display text: decoded as the element the table names for it when it has a renderer and the octets decode as those elements to the end, and otherwise as application values.
Sourcepub fn value_at(
&self,
property: PropertyIdentifier,
index: Option<u32>,
data: &[u8],
) -> String
pub fn value_at( &self, property: PropertyIdentifier, index: Option<u32>, data: &[u8], ) -> String
Self::value of a read at an array index: one element of a
collection for an index above 0, the array’s size for index 0.
Sourcepub fn with_units(
&self,
property: PropertyIdentifier,
data: &[u8],
units: Option<EngineeringUnits>,
) -> String
pub fn with_units( &self, property: PropertyIdentifier, data: &[u8], units: Option<EngineeringUnits>, ) -> String
A value with the units after it, as the compact places show it:
72.5 °F. Only numbers take units.
Sourcepub fn plain(&self, property: PropertyIdentifier, data: &[u8]) -> String
pub fn plain(&self, property: PropertyIdentifier, data: &[u8]) -> String
A property’s value as the device card shows it: a string without its quotes.
Sourcepub fn element(
&self,
property: PropertyIdentifier,
value: &PropertyValue,
) -> String
pub fn element( &self, property: PropertyIdentifier, value: &PropertyValue, ) -> String
One application value of property.