Skip to main content

FieldDescription

Struct FieldDescription 

Source
pub struct FieldDescription<'a, T: ?Sized, K> { /* private fields */ }
Expand description

A developer field’s description, given to Writer::declare.

A value is written as given; scale and offset only tell readers how to read it, and not all of them do, so a physical value in a type that holds it exactly, or a float, reads the same everywhere.

Implementations§

Source§

impl<'a, T: ?Sized, K> FieldDescription<'a, T, K>

Source

pub const fn units(self, units: &'a str) -> Self

Its units for display, up to UNITS_MAX bytes.

Source

pub const fn scale(self, scale: u8) -> Self

The value readers divide by, from 1 to 254.

Source

pub const fn offset(self, offset: i8) -> Self

The value readers subtract after scaling, from -128 to 126.

Source

pub const fn native_field(self, num: u8) -> Self

The profile field of K’s message this field stands in for, which some readers then show as that field. Its units are the native field’s, without its scale and offset.

Trait Implementations§

Source§

impl<T: ?Sized, K> Debug for FieldDescription<'_, T, K>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, T, K> Forget for FieldDescription<'a, T, K>
where T: ?Sized,

§

impl<'a, T, K> Freeze for FieldDescription<'a, T, K>
where &'a str: Freeze, PhantomData<(fn() -> *const T, fn() -> K)>: Freeze, T: ?Sized,

§

impl<'a, T, K> Move for FieldDescription<'a, T, K>
where T: ?Sized,

§

impl<'a, T, K> RefUnwindSafe for FieldDescription<'a, T, K>
where T: ?Sized,

§

impl<'a, T, K> Send for FieldDescription<'a, T, K>
where &'a str: Send, T: ?Sized,

§

impl<'a, T, K> Sync for FieldDescription<'a, T, K>
where T: ?Sized,

§

impl<'a, T, K> Unpin for FieldDescription<'a, T, K>
where &'a str: Unpin, T: ?Sized,

§

impl<'a, T, K> UnsafeUnpin for FieldDescription<'a, T, K>
where &'a str: UnsafeUnpin, PhantomData<(fn() -> *const T, fn() -> K)>: UnsafeUnpin, T: ?Sized,

§

impl<'a, T, K> UnwindSafe for FieldDescription<'a, T, K>
where &'a str: UnwindSafe, T: ?Sized,

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<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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.