pub struct ConstDecimals<DECIMALS>where
DECIMALS: Unsigned,{ /* private fields */ }
Expand description
Zero-sized constant number of decimals.
Ideal if the number of decimals is known at compile time.
Implementations§
Source§impl<DECIMALS> ConstDecimals<DECIMALS>where
DECIMALS: Unsigned,
impl<DECIMALS> ConstDecimals<DECIMALS>where
DECIMALS: Unsigned,
pub fn new() -> ConstDecimals<DECIMALS>
Trait Implementations§
Source§impl<DEC1, DEC2> Add<ConstDecimals<DEC2>> for ConstDecimals<DEC1>
impl<DEC1, DEC2> Add<ConstDecimals<DEC2>> for ConstDecimals<DEC1>
Source§type Output = ConstDecimals<<DEC1 as Add<DEC2>>::Output>
type Output = ConstDecimals<<DEC1 as Add<DEC2>>::Output>
The resulting type after applying the
+
operator.Source§fn add(
self,
_rhs: ConstDecimals<DEC2>,
) -> <ConstDecimals<DEC1> as Add<ConstDecimals<DEC2>>>::Output
fn add( self, _rhs: ConstDecimals<DEC2>, ) -> <ConstDecimals<DEC1> as Add<ConstDecimals<DEC2>>>::Output
Performs the
+
operation. Read moreSource§impl<DECIMALS> Clone for ConstDecimals<DECIMALS>
impl<DECIMALS> 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§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<DECIMALS> Debug for ConstDecimals<DECIMALS>
impl<DECIMALS> Debug for ConstDecimals<DECIMALS>
Source§impl<DECIMALS> Decimals for ConstDecimals<DECIMALS>where
DECIMALS: Unsigned,
impl<DECIMALS> Decimals for ConstDecimals<DECIMALS>where
DECIMALS: Unsigned,
Source§fn num_decimals(&self) -> usize
fn num_decimals(&self) -> usize
Number of decimals as variable.
Source§fn scaling_factor<M>(&self) -> ManagedRef<'static, M, BigUint<M>>where
M: ManagedTypeApi,
fn scaling_factor<M>(&self) -> ManagedRef<'static, M, BigUint<M>>where
M: ManagedTypeApi,
10^num_decimals, represented as a
BigUint
.Source§impl<DECIMALS> Default for ConstDecimals<DECIMALS>
impl<DECIMALS> 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>
Source§type Output = ConstDecimals<<DEC1 as Sub<DEC2>>::Output>
type Output = ConstDecimals<<DEC1 as Sub<DEC2>>::Output>
The resulting type after applying the
-
operator.Source§fn sub(
self,
_rhs: ConstDecimals<DEC2>,
) -> <ConstDecimals<DEC1> as Sub<ConstDecimals<DEC2>>>::Output
fn sub( self, _rhs: ConstDecimals<DEC2>, ) -> <ConstDecimals<DEC1> as Sub<ConstDecimals<DEC2>>>::Output
Performs the
-
operation. Read moreAuto 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> InterpretableFrom<&T> for Twhere
T: Clone,
impl<T> InterpretableFrom<&T> for Twhere
T: Clone,
fn interpret_from(from: &T, _context: &InterpreterContext) -> T
Source§impl<T> InterpretableFrom<T> for T
impl<T> InterpretableFrom<T> for T
fn interpret_from(from: T, _context: &InterpreterContext) -> T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more