Struct scrypto_test::prelude::DEFAULT_VALIDATOR_USD_COST
source · pub struct DEFAULT_VALIDATOR_USD_COST {
__private_field: (),
}
Fields§
§__private_field: ()
Methods from Deref<Target = Decimal>§
pub const MIN: Decimal = _
pub const MAX: Decimal = _
pub const BITS: usize = 192usize
pub const SCALE: u32 = 18u32
pub const ZERO: Decimal = _
pub const ONE_HUNDREDTH: Decimal = _
pub const ONE_TENTH: Decimal = _
pub const ONE: Decimal = _
pub const TEN: Decimal = _
pub const ONE_HUNDRED: Decimal = _
sourcepub fn is_positive(&self) -> bool
pub fn is_positive(&self) -> bool
Whether this decimal is positive.
sourcepub fn is_negative(&self) -> bool
pub fn is_negative(&self) -> bool
Whether this decimal is negative.
sourcepub fn checked_abs(&self) -> Option<Decimal>
pub fn checked_abs(&self) -> Option<Decimal>
Returns the absolute value.
sourcepub fn checked_floor(&self) -> Option<Decimal>
pub fn checked_floor(&self) -> Option<Decimal>
Returns the largest integer that is equal to or less than this number.
sourcepub fn checked_ceiling(&self) -> Option<Decimal>
pub fn checked_ceiling(&self) -> Option<Decimal>
Returns the smallest integer that is equal to or greater than this number.
sourcepub fn checked_round<T>(
&self,
decimal_places: T,
mode: RoundingMode
) -> Option<Decimal>
pub fn checked_round<T>( &self, decimal_places: T, mode: RoundingMode ) -> Option<Decimal>
Rounds this number to the specified decimal places.
§Panics
- Panic if the number of decimal places is not within [0..SCALE]
sourcepub fn checked_powi(&self, exp: i64) -> Option<Decimal>
pub fn checked_powi(&self, exp: i64) -> Option<Decimal>
Calculates power using exponentiation by squaring“.
sourcepub fn checked_sqrt(&self) -> Option<Decimal>
pub fn checked_sqrt(&self) -> Option<Decimal>
Square root of a Decimal
sourcepub fn checked_cbrt(&self) -> Option<Decimal>
pub fn checked_cbrt(&self) -> Option<Decimal>
Cubic root of a Decimal
sourcepub fn checked_nth_root(&self, n: u32) -> Option<Decimal>
pub fn checked_nth_root(&self, n: u32) -> Option<Decimal>
Nth root of a Decimal
pub fn to_vec(&self) -> Vec<u8> ⓘ
Trait Implementations§
source§impl Deref for DEFAULT_VALIDATOR_USD_COST
impl Deref for DEFAULT_VALIDATOR_USD_COST
impl LazyStatic for DEFAULT_VALIDATOR_USD_COST
Auto Trait Implementations§
impl RefUnwindSafe for DEFAULT_VALIDATOR_USD_COST
impl Send for DEFAULT_VALIDATOR_USD_COST
impl Sync for DEFAULT_VALIDATOR_USD_COST
impl Unpin for DEFAULT_VALIDATOR_USD_COST
impl UnwindSafe for DEFAULT_VALIDATOR_USD_COST
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.