Skip to main content

ValueFormat

Struct ValueFormat 

Source
pub struct ValueFormat<'a> { /* private fields */ }
Expand description

Formats the values of one object.

Implementations§

Source§

impl ValueFormat<'_>

Source

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.

Source

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.

Source

pub fn element_data( &self, property: PropertyIdentifier, value: &PropertyValue, ) -> Datum

One application value of property as typed data.

Source§

impl ValueFormat<'_>

Source

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.

Source

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.

Source

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.

Source

pub fn logged_octets_data( &self, column: Option<LoggedProperty>, octets: &[u8], ) -> Datum

Self::logged_octets as typed data.

Source§

impl<'a> ValueFormat<'a>

Source

pub fn new( object_type: ObjectType, texts: &'a StateTexts, floats: Floats, ) -> Self

A formatter for an object of object_type.

Source

pub fn whole_lists(self) -> Self

The same formatter, showing every element of a list instead of the first few and a count.

Source

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.

Source

pub fn real(&self, value: f32) -> String

A REAL in this formatter’s float style.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn plain(&self, property: PropertyIdentifier, data: &[u8]) -> String

A property’s value as the device card shows it: a string without its quotes.

Source

pub fn element( &self, property: PropertyIdentifier, value: &PropertyValue, ) -> String

One application value of property.

Trait Implementations§

Source§

impl<'a> Clone for ValueFormat<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for ValueFormat<'a>

Source§

impl<'a> Debug for ValueFormat<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ValueFormat<'a>

§

impl<'a> RefUnwindSafe for ValueFormat<'a>

§

impl<'a> Send for ValueFormat<'a>

§

impl<'a> Sync for ValueFormat<'a>

§

impl<'a> Unpin for ValueFormat<'a>

§

impl<'a> UnsafeUnpin for ValueFormat<'a>

§

impl<'a> UnwindSafe for ValueFormat<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more