#[repr(u8)]pub enum Precision {
Show 19 variants
Indivisible = 0,
Deci = 1,
Centi = 2,
Milli = 3,
DeciMilli = 4,
CentiMilli = 5,
Micro = 6,
DeciMicro = 7,
CentiMicro = 8,
Nano = 9,
DeciNano = 10,
CentiNano = 11,
Pico = 12,
DeciPico = 13,
CentiPico = 14,
Femto = 15,
DeciFemto = 16,
CentiFemto = 17,
Atto = 18,
}
Variants§
Indivisible = 0
Deci = 1
Centi = 2
Milli = 3
DeciMilli = 4
CentiMilli = 5
Micro = 6
DeciMicro = 7
CentiMicro = 8
Nano = 9
DeciNano = 10
CentiNano = 11
Pico = 12
DeciPico = 13
CentiPico = 14
Femto = 15
DeciFemto = 16
CentiFemto = 17
Atto = 18
Implementations§
Source§impl Precision
impl Precision
pub fn from_strict_val_unchecked(value: &StrictVal) -> Self
pub const fn decimals(self) -> u8
pub const fn multiplier(self) -> u64
pub fn unchecked_convert(self, amount: impl Into<u64>) -> Amount
pub fn checked_convert(self, amount: impl Into<u64>) -> Option<Amount>
pub fn saturating_convert(self, amount: impl Into<u64>) -> Amount
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Precision
impl<'de> Deserialize<'de> for Precision
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Precision
impl Ord for Precision
Source§impl PartialOrd for Precision
impl PartialOrd for Precision
Source§impl StrictDecode for Precision
impl StrictDecode for Precision
fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictDeserialize for Precision
impl StrictDeserialize for Precision
fn from_strict_serialized<const MAX: usize>( ast_data: Confined<Vec<u8>, 0, MAX>, ) -> Result<Self, DeserializeError>
fn strict_deserialize<const MAX: usize>( read: impl Read, ) -> Result<Self, DeserializeError>
fn strict_deserialize_from_file<const MAX: usize>( path: impl AsRef<Path>, ) -> Result<Self, DeserializeError>
Source§impl StrictEncode for Precision
impl StrictEncode for Precision
fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictEnum for Precision
impl StrictEnum for Precision
fn from_variant_name( name: &VariantName, ) -> Result<Self, VariantError<&VariantName>>
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictSerialize for Precision
impl StrictSerialize for Precision
fn strict_serialized_len<const MAX: usize>(&self) -> Result<usize, Error>
fn to_strict_serialized<const MAX: usize>( &self, ) -> Result<Confined<Vec<u8>, 0, MAX>, SerializeError>
fn strict_serialize<const MAX: usize>( &self, write: impl Write, ) -> Result<(), Error>
fn strict_serialize_to_file<const MAX: usize>( &self, path: impl AsRef<Path>, ) -> Result<(), SerializeError>
Source§impl StrictSum for Precision
impl StrictSum for Precision
const ALL_VARIANTS: &'static [(u8, &'static str)]
fn variant_name(&self) -> &'static str
fn strict_check_variants()
fn variant_name_by_tag(tag: u8) -> Option<VariantName>
fn variant_ord(&self) -> u8
Source§impl StrictType for Precision
impl StrictType for Precision
const STRICT_LIB_NAME: &'static str = LIB_NAME_RGB_CONTRACT
fn strict_name() -> Option<TypeName>
impl Copy for Precision
impl Eq for Precision
impl StructuralPartialEq for Precision
Auto Trait Implementations§
impl Freeze for Precision
impl RefUnwindSafe for Precision
impl Send for Precision
impl Sync for Precision
impl Unpin for Precision
impl UnwindSafe for Precision
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.