Skip to main content

Value

Struct Value 

Source
pub struct Value<I, const FRAC: usize> {
    pub value: I,
}
Expand description

A wrapper type representing an un-scaled raw value in a fixed-point format, used for intermediate conversion step calculations.

Fields§

§value: I

The underlying raw value.

Trait Implementations§

Source§

impl<I: Clone, const FRAC: usize> Clone for Value<I, FRAC>

Source§

fn clone(&self) -> Self

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

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

Performs copy-assignment from source. Read more
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i8, FRAC_DST> for Value<i8, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i8, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i8, FRAC_DST> for Value<i16, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i8, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i8, FRAC_DST> for Value<i32, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i8, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i8, FRAC_DST> for Value<i64, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i8, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i8, FRAC_DST> for Value<u8, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i8, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i8, FRAC_DST> for Value<u16, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i8, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i8, FRAC_DST> for Value<u32, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i8, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i8, FRAC_DST> for Value<u64, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i8, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i16, FRAC_DST> for Value<i8, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i16, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i16, FRAC_DST> for Value<i16, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i16, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i16, FRAC_DST> for Value<i32, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i16, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i16, FRAC_DST> for Value<i64, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i16, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i16, FRAC_DST> for Value<u8, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i16, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i16, FRAC_DST> for Value<u16, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i16, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i16, FRAC_DST> for Value<u32, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i16, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i16, FRAC_DST> for Value<u64, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i16, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i32, FRAC_DST> for Value<i8, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i32, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i32, FRAC_DST> for Value<i16, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i32, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i32, FRAC_DST> for Value<i32, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i32, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i32, FRAC_DST> for Value<i64, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i32, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i32, FRAC_DST> for Value<u8, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i32, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i32, FRAC_DST> for Value<u16, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i32, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i32, FRAC_DST> for Value<u32, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i32, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i32, FRAC_DST> for Value<u64, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i32, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i64, FRAC_DST> for Value<i8, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i64, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i64, FRAC_DST> for Value<i16, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i64, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i64, FRAC_DST> for Value<i32, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i64, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i64, FRAC_DST> for Value<i64, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i64, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i64, FRAC_DST> for Value<u8, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i64, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i64, FRAC_DST> for Value<u16, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i64, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i64, FRAC_DST> for Value<u32, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i64, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i64, FRAC_DST> for Value<u64, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i64, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i128, FRAC_DST> for Value<i8, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i128, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i128, FRAC_DST> for Value<i16, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i128, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i128, FRAC_DST> for Value<i32, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i128, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i128, FRAC_DST> for Value<i64, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i128, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i128, FRAC_DST> for Value<u8, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i128, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i128, FRAC_DST> for Value<u16, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i128, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i128, FRAC_DST> for Value<u32, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i128, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<i128, FRAC_DST> for Value<u64, FRAC_SRC>

Source§

fn convert_value(self) -> Value<i128, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u8, FRAC_DST> for Value<u8, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u8, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u8, FRAC_DST> for Value<u16, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u8, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u8, FRAC_DST> for Value<u32, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u8, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u8, FRAC_DST> for Value<u64, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u8, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u8, FRAC_DST> for Value<i8, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u8, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u8, FRAC_DST> for Value<i16, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u8, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u8, FRAC_DST> for Value<i32, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u8, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u8, FRAC_DST> for Value<i64, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u8, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u16, FRAC_DST> for Value<u8, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u16, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u16, FRAC_DST> for Value<u16, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u16, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u16, FRAC_DST> for Value<u32, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u16, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u16, FRAC_DST> for Value<u64, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u16, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u16, FRAC_DST> for Value<i8, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u16, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u16, FRAC_DST> for Value<i16, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u16, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u16, FRAC_DST> for Value<i32, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u16, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u16, FRAC_DST> for Value<i64, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u16, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u32, FRAC_DST> for Value<u8, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u32, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u32, FRAC_DST> for Value<u16, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u32, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u32, FRAC_DST> for Value<u32, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u32, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u32, FRAC_DST> for Value<u64, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u32, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u32, FRAC_DST> for Value<i8, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u32, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u32, FRAC_DST> for Value<i16, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u32, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u32, FRAC_DST> for Value<i32, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u32, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u32, FRAC_DST> for Value<i64, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u32, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u64, FRAC_DST> for Value<u8, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u64, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u64, FRAC_DST> for Value<u16, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u64, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u64, FRAC_DST> for Value<u32, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u64, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u64, FRAC_DST> for Value<u64, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u64, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u64, FRAC_DST> for Value<i8, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u64, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u64, FRAC_DST> for Value<i16, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u64, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u64, FRAC_DST> for Value<i32, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u64, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<const FRAC_SRC: usize, const FRAC_DST: usize> ConvertValue<u64, FRAC_DST> for Value<i64, FRAC_SRC>

Source§

fn convert_value(self) -> Value<u64, FRAC_DST>

Converts self to a Value of another fixed-point format.
Source§

impl<I: Copy, const FRAC: usize> Copy for Value<I, FRAC>

Source§

impl<I: Debug, const FRAC: usize> Debug for Value<I, FRAC>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<I: Eq, const FRAC: usize> Eq for Value<I, FRAC>

Source§

impl<I: Copy, const FRAC: usize> From<Value<I, FRAC>> for Fixed<I, FRAC>

Source§

fn from(val: Value<I, FRAC>) -> Self

Converts to this type from the input type.
Source§

impl<I: PartialEq, const FRAC: usize> PartialEq for Value<I, FRAC>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable)§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<I: PartialEq, const FRAC: usize> StructuralPartialEq for Value<I, FRAC>

Auto Trait Implementations§

§

impl<I, const FRAC: usize> Freeze for Value<I, FRAC>
where I: Freeze,

§

impl<I, const FRAC: usize> RefUnwindSafe for Value<I, FRAC>
where I: RefUnwindSafe,

§

impl<I, const FRAC: usize> Send for Value<I, FRAC>
where I: Send,

§

impl<I, const FRAC: usize> Sync for Value<I, FRAC>
where I: Sync,

§

impl<I, const FRAC: usize> Unpin for Value<I, FRAC>
where I: Unpin,

§

impl<I, const FRAC: usize> UnsafeUnpin for Value<I, FRAC>
where I: UnsafeUnpin,

§

impl<I, const FRAC: usize> UnwindSafe for Value<I, FRAC>
where I: UnwindSafe,

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

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

§

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
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = !

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

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

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where 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>

Performs the conversion.