pub struct ConstDecimals<DECIMALS: Unsigned> { /* private fields */ }Expand description
Zero-sized constant number of decimals.
Ideal if the number of decimals is known at compile time.
Implementations§
Trait Implementations§
Source§impl<DEC1, DEC2> Add<ConstDecimals<DEC2>> for ConstDecimals<DEC1>
impl<DEC1, DEC2> Add<ConstDecimals<DEC2>> for ConstDecimals<DEC1>
Source§impl<DECIMALS: Clone + Unsigned> Clone for ConstDecimals<DECIMALS>
impl<DECIMALS: Clone + Unsigned> Clone for ConstDecimals<DECIMALS>
Source§fn clone(&self) -> ConstDecimals<DECIMALS>
fn clone(&self) -> ConstDecimals<DECIMALS>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<DECIMALS: Unsigned> Decimals for ConstDecimals<DECIMALS>
impl<DECIMALS: Unsigned> Decimals for ConstDecimals<DECIMALS>
Source§fn num_decimals(&self) -> NumDecimals
fn num_decimals(&self) -> NumDecimals
Number of decimals as variable.
Source§fn scaling_factor<M: ManagedTypeApi>(
&self,
) -> ManagedRef<'static, M, BigUint<M>>
fn scaling_factor<M: ManagedTypeApi>( &self, ) -> ManagedRef<'static, M, BigUint<M>>
10^num_decimals, represented as a
BigUint.Source§impl<DECIMALS: Default + Unsigned> Default for ConstDecimals<DECIMALS>
impl<DECIMALS: Default + Unsigned> Default for ConstDecimals<DECIMALS>
Source§fn default() -> ConstDecimals<DECIMALS>
fn default() -> ConstDecimals<DECIMALS>
Returns the “default value” for a type. Read more
Source§impl<DEC1, DEC2> Sub<ConstDecimals<DEC2>> for ConstDecimals<DEC1>
impl<DEC1, DEC2> Sub<ConstDecimals<DEC2>> for ConstDecimals<DEC1>
Auto Trait Implementations§
impl<DECIMALS> Freeze for ConstDecimals<DECIMALS>
impl<DECIMALS> RefUnwindSafe for ConstDecimals<DECIMALS>where
DECIMALS: RefUnwindSafe,
impl<DECIMALS> Send for ConstDecimals<DECIMALS>where
DECIMALS: Send,
impl<DECIMALS> Sync for ConstDecimals<DECIMALS>where
DECIMALS: Sync,
impl<DECIMALS> Unpin for ConstDecimals<DECIMALS>where
DECIMALS: Unpin,
impl<DECIMALS> UnwindSafe for ConstDecimals<DECIMALS>where
DECIMALS: UnwindSafe,
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