Struct levana_perpswap_cosmos::prelude::Decimal256
pub struct Decimal256(/* private fields */);
Expand description
A fixed-point decimal value with 18 fractional digits, i.e. Decimal256(1_000_000_000_000_000_000) == 1.0
The greatest possible value that can be represented is 115792089237316195423570985008687907853269984665640564039457.584007913129639935 (which is (2^256 - 1) / 10^18)
Implementations§
§impl Decimal256
impl Decimal256
pub const DECIMAL_PLACES: u32 = 18u32
pub const DECIMAL_PLACES: u32 = 18u32
The number of decimal places. Since decimal types are fixed-point rather than floating-point, this is a constant.
pub const MAX: Decimal256 = _
pub const MAX: Decimal256 = _
The largest value that can be represented by this decimal type.
pub const MIN: Decimal256 = _
pub const MIN: Decimal256 = _
The smallest value that can be represented by this decimal type.
pub const fn new(value: Uint256) -> Decimal256
pub const fn new(value: Uint256) -> Decimal256
Creates a Decimal256 from Uint256
This is equivalent to Decimal256::from_atomics(value, 18)
but usable in a const context.
pub const fn raw(value: u128) -> Decimal256
pub const fn raw(value: u128) -> Decimal256
Creates a Decimal256 from u128
This is equivalent to Decimal256::from_atomics(value, 18)
but usable in a const context.
pub const fn one() -> Decimal256
pub const fn one() -> Decimal256
Create a 1.0 Decimal256
pub const fn zero() -> Decimal256
pub const fn zero() -> Decimal256
Create a 0.0 Decimal256
pub const fn percent(x: u64) -> Decimal256
pub const fn percent(x: u64) -> Decimal256
Convert x% into Decimal256
§Examples
const HALF: Decimal256 = Decimal256::percent(50);
assert_eq!(HALF, Decimal256::from_str("0.5").unwrap());
pub const fn permille(x: u64) -> Decimal256
pub const fn permille(x: u64) -> Decimal256
Convert permille (x/1000) into Decimal256
§Examples
const HALF: Decimal256 = Decimal256::permille(500);
assert_eq!(HALF, Decimal256::from_str("0.5").unwrap());
pub const fn bps(x: u64) -> Decimal256
pub const fn bps(x: u64) -> Decimal256
Convert basis points (x/10000) into Decimal256
§Examples
const TWO_BPS: Decimal256 = Decimal256::bps(2);
const HALF: Decimal256 = Decimal256::bps(5000);
assert_eq!(TWO_BPS, Decimal256::from_str("0.0002").unwrap());
assert_eq!(HALF, Decimal256::from_str("0.5").unwrap());
pub fn from_atomics(
atomics: impl Into<Uint256>,
decimal_places: u32,
) -> Result<Decimal256, Decimal256RangeExceeded>
pub fn from_atomics( atomics: impl Into<Uint256>, decimal_places: u32, ) -> Result<Decimal256, Decimal256RangeExceeded>
Creates a decimal from a number of atomic units and the number of decimal places. The inputs will be converted internally to form a decimal with 18 decimal places. So the input 123 and 2 will create the decimal 1.23.
Using 18 decimal places is slightly more efficient than other values as no internal conversion is necessary.
§Examples
let a = Decimal256::from_atomics(1234u64, 3).unwrap();
assert_eq!(a.to_string(), "1.234");
let a = Decimal256::from_atomics(1234u128, 0).unwrap();
assert_eq!(a.to_string(), "1234");
let a = Decimal256::from_atomics(1u64, 18).unwrap();
assert_eq!(a.to_string(), "0.000000000000000001");
let a = Decimal256::from_atomics(Uint256::MAX, 18).unwrap();
assert_eq!(a, Decimal256::MAX);
pub fn from_ratio(
numerator: impl Into<Uint256>,
denominator: impl Into<Uint256>,
) -> Decimal256
pub fn from_ratio( numerator: impl Into<Uint256>, denominator: impl Into<Uint256>, ) -> Decimal256
Returns the ratio (numerator / denominator) as a Decimal256
pub fn checked_from_ratio(
numerator: impl Into<Uint256>,
denominator: impl Into<Uint256>,
) -> Result<Decimal256, CheckedFromRatioError>
pub fn checked_from_ratio( numerator: impl Into<Uint256>, denominator: impl Into<Uint256>, ) -> Result<Decimal256, CheckedFromRatioError>
Returns the ratio (numerator / denominator) as a Decimal256
pub const fn is_zero(&self) -> bool
pub const fn atomics(&self) -> Uint256
pub const fn atomics(&self) -> Uint256
A decimal is an integer of atomic units plus a number that specifies the position of the decimal dot. So any decimal can be expressed as two numbers.
§Examples
// Value with whole and fractional part
let a = Decimal256::from_str("1.234").unwrap();
assert_eq!(a.decimal_places(), 18);
assert_eq!(a.atomics(), Uint256::from(1234000000000000000u128));
// Smallest possible value
let b = Decimal256::from_str("0.000000000000000001").unwrap();
assert_eq!(b.decimal_places(), 18);
assert_eq!(b.atomics(), Uint256::from(1u128));
pub const fn decimal_places(&self) -> u32
pub const fn decimal_places(&self) -> u32
The number of decimal places. This is a constant value for now but this could potentially change as the type evolves.
See also Decimal256::atomics()
.
pub fn floor(&self) -> Decimal256
pub fn floor(&self) -> Decimal256
Rounds value down after decimal places.
pub fn ceil(&self) -> Decimal256
pub fn ceil(&self) -> Decimal256
Rounds value up after decimal places. Panics on overflow.
pub fn checked_ceil(&self) -> Result<Decimal256, RoundUpOverflowError>
pub fn checked_ceil(&self) -> Result<Decimal256, RoundUpOverflowError>
Rounds value up after decimal places. Returns OverflowError on overflow.
pub fn checked_add(self, other: Decimal256) -> Result<Decimal256, OverflowError>
pub fn checked_sub(self, other: Decimal256) -> Result<Decimal256, OverflowError>
pub fn checked_mul(self, other: Decimal256) -> Result<Decimal256, OverflowError>
pub fn checked_mul(self, other: Decimal256) -> Result<Decimal256, OverflowError>
Multiplies one Decimal256
by another, returning an OverflowError
if an overflow occurred.
pub fn pow(self, exp: u32) -> Decimal256
pub fn pow(self, exp: u32) -> Decimal256
Raises a value to the power of exp
, panics if an overflow occurred.
pub fn checked_pow(self, exp: u32) -> Result<Decimal256, OverflowError>
pub fn checked_pow(self, exp: u32) -> Result<Decimal256, OverflowError>
Raises a value to the power of exp
, returning an OverflowError
if an overflow occurred.
pub fn checked_div( self, other: Decimal256, ) -> Result<Decimal256, CheckedFromRatioError>
pub fn checked_rem( self, other: Decimal256, ) -> Result<Decimal256, DivideByZeroError>
pub fn sqrt(&self) -> Decimal256
pub fn sqrt(&self) -> Decimal256
Returns the approximate square root as a Decimal256.
This should not overflow or panic.
pub fn abs_diff(self, other: Decimal256) -> Decimal256
pub fn saturating_add(self, other: Decimal256) -> Decimal256
pub fn saturating_sub(self, other: Decimal256) -> Decimal256
pub fn saturating_mul(self, other: Decimal256) -> Decimal256
pub fn saturating_pow(self, exp: u32) -> Decimal256
pub fn to_uint_floor(self) -> Uint256
pub fn to_uint_floor(self) -> Uint256
Converts this decimal to an unsigned integer by truncating the fractional part, e.g. 22.5 becomes 22.
§Examples
use core::str::FromStr;
use cosmwasm_std::{Decimal256, Uint256};
let d = Decimal256::from_str("12.345").unwrap();
assert_eq!(d.to_uint_floor(), Uint256::from(12u64));
let d = Decimal256::from_str("12.999").unwrap();
assert_eq!(d.to_uint_floor(), Uint256::from(12u64));
let d = Decimal256::from_str("75.0").unwrap();
assert_eq!(d.to_uint_floor(), Uint256::from(75u64));
pub fn to_uint_ceil(self) -> Uint256
pub fn to_uint_ceil(self) -> Uint256
Converts this decimal to an unsigned integer by rounting up to the next integer, e.g. 22.3 becomes 23.
§Examples
use core::str::FromStr;
use cosmwasm_std::{Decimal256, Uint256};
let d = Decimal256::from_str("12.345").unwrap();
assert_eq!(d.to_uint_ceil(), Uint256::from(13u64));
let d = Decimal256::from_str("12.999").unwrap();
assert_eq!(d.to_uint_ceil(), Uint256::from(13u64));
let d = Decimal256::from_str("75.0").unwrap();
assert_eq!(d.to_uint_ceil(), Uint256::from(75u64));
Trait Implementations§
§impl Add<&Decimal256> for &Decimal256
impl Add<&Decimal256> for &Decimal256
§type Output = <Decimal256 as Add>::Output
type Output = <Decimal256 as Add>::Output
+
operator.§fn add(self, other: &Decimal256) -> <Decimal256 as Add>::Output
fn add(self, other: &Decimal256) -> <Decimal256 as Add>::Output
+
operation. Read more§impl Add<&Decimal256> for Decimal256
impl Add<&Decimal256> for Decimal256
§type Output = <Decimal256 as Add>::Output
type Output = <Decimal256 as Add>::Output
+
operator.§fn add(self, other: &Decimal256) -> <Decimal256 as Add>::Output
fn add(self, other: &Decimal256) -> <Decimal256 as Add>::Output
+
operation. Read more§impl<'a> Add<Decimal256> for &'a Decimal256
impl<'a> Add<Decimal256> for &'a Decimal256
§type Output = <Decimal256 as Add>::Output
type Output = <Decimal256 as Add>::Output
+
operator.§fn add(self, other: Decimal256) -> <Decimal256 as Add>::Output
fn add(self, other: Decimal256) -> <Decimal256 as Add>::Output
+
operation. Read more§impl Add for Decimal256
impl Add for Decimal256
§type Output = Decimal256
type Output = Decimal256
+
operator.§fn add(self, other: Decimal256) -> Decimal256
fn add(self, other: Decimal256) -> Decimal256
+
operation. Read more§impl AddAssign<&Decimal256> for Decimal256
impl AddAssign<&Decimal256> for Decimal256
§fn add_assign(&mut self, other: &Decimal256)
fn add_assign(&mut self, other: &Decimal256)
+=
operation. Read more§impl AddAssign for Decimal256
impl AddAssign for Decimal256
§fn add_assign(&mut self, rhs: Decimal256)
fn add_assign(&mut self, rhs: Decimal256)
+=
operation. Read more§impl Clone for Decimal256
impl Clone for Decimal256
§fn clone(&self) -> Decimal256
fn clone(&self) -> Decimal256
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for Decimal256
impl Debug for Decimal256
§impl Default for Decimal256
impl Default for Decimal256
§fn default() -> Decimal256
fn default() -> Decimal256
§impl<'de> Deserialize<'de> for Decimal256
impl<'de> Deserialize<'de> for Decimal256
Deserializes as a base64 string
§fn deserialize<D>(
deserializer: D,
) -> Result<Decimal256, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Decimal256, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl Display for Decimal256
impl Display for Decimal256
§impl Div<&Decimal256> for &Decimal256
impl Div<&Decimal256> for &Decimal256
§type Output = <Decimal256 as Div>::Output
type Output = <Decimal256 as Div>::Output
/
operator.§fn div(self, other: &Decimal256) -> <Decimal256 as Div>::Output
fn div(self, other: &Decimal256) -> <Decimal256 as Div>::Output
/
operation. Read more§impl Div<&Decimal256> for Decimal256
impl Div<&Decimal256> for Decimal256
§type Output = <Decimal256 as Div>::Output
type Output = <Decimal256 as Div>::Output
/
operator.§fn div(self, other: &Decimal256) -> <Decimal256 as Div>::Output
fn div(self, other: &Decimal256) -> <Decimal256 as Div>::Output
/
operation. Read more§impl<'a> Div<Decimal256> for &'a Decimal256
impl<'a> Div<Decimal256> for &'a Decimal256
§type Output = <Decimal256 as Div>::Output
type Output = <Decimal256 as Div>::Output
/
operator.§fn div(self, other: Decimal256) -> <Decimal256 as Div>::Output
fn div(self, other: Decimal256) -> <Decimal256 as Div>::Output
/
operation. Read more§impl Div<Uint256> for Decimal256
impl Div<Uint256> for Decimal256
§type Output = Decimal256
type Output = Decimal256
/
operator.§impl Div for Decimal256
impl Div for Decimal256
§type Output = Decimal256
type Output = Decimal256
/
operator.§fn div(self, other: Decimal256) -> Decimal256
fn div(self, other: Decimal256) -> Decimal256
/
operation. Read more§impl DivAssign<&Decimal256> for Decimal256
impl DivAssign<&Decimal256> for Decimal256
§fn div_assign(&mut self, other: &Decimal256)
fn div_assign(&mut self, other: &Decimal256)
/=
operation. Read more§impl DivAssign<Uint256> for Decimal256
impl DivAssign<Uint256> for Decimal256
§fn div_assign(&mut self, rhs: Uint256)
fn div_assign(&mut self, rhs: Uint256)
/=
operation. Read more§impl DivAssign for Decimal256
impl DivAssign for Decimal256
§fn div_assign(&mut self, rhs: Decimal256)
fn div_assign(&mut self, rhs: Decimal256)
/=
operation. Read more§impl Fraction<Uint256> for Decimal256
impl Fraction<Uint256> for Decimal256
§fn inv(&self) -> Option<Decimal256>
fn inv(&self) -> Option<Decimal256>
Returns the multiplicative inverse 1/d
for decimal d
.
If d
is zero, none is returned.
§fn denominator(&self) -> Uint256
fn denominator(&self) -> Uint256
q
§impl From<Decimal> for Decimal256
impl From<Decimal> for Decimal256
§fn from(input: Decimal) -> Decimal256
fn from(input: Decimal) -> Decimal256
§impl FromStr for Decimal256
impl FromStr for Decimal256
§fn from_str(input: &str) -> Result<Decimal256, <Decimal256 as FromStr>::Err>
fn from_str(input: &str) -> Result<Decimal256, <Decimal256 as FromStr>::Err>
Converts the decimal string to a Decimal256 Possible inputs: “1.23”, “1”, “000012”, “1.123000000” Disallowed: “”, “.23”
This never performs any kind of rounding. More than DECIMAL_PLACES fractional digits, even zeros, result in an error.
§impl JsonSchema for Decimal256
impl JsonSchema for Decimal256
§fn schema_name() -> String
fn schema_name() -> String
§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read more§impl Mul<&Decimal256> for &Decimal256
impl Mul<&Decimal256> for &Decimal256
§type Output = <Decimal256 as Mul>::Output
type Output = <Decimal256 as Mul>::Output
*
operator.§fn mul(self, other: &Decimal256) -> <Decimal256 as Mul>::Output
fn mul(self, other: &Decimal256) -> <Decimal256 as Mul>::Output
*
operation. Read more§impl Mul<&Decimal256> for Decimal256
impl Mul<&Decimal256> for Decimal256
§type Output = <Decimal256 as Mul>::Output
type Output = <Decimal256 as Mul>::Output
*
operator.§fn mul(self, other: &Decimal256) -> <Decimal256 as Mul>::Output
fn mul(self, other: &Decimal256) -> <Decimal256 as Mul>::Output
*
operation. Read more§impl<'a> Mul<Decimal256> for &'a Decimal256
impl<'a> Mul<Decimal256> for &'a Decimal256
§type Output = <Decimal256 as Mul>::Output
type Output = <Decimal256 as Mul>::Output
*
operator.§fn mul(self, other: Decimal256) -> <Decimal256 as Mul>::Output
fn mul(self, other: Decimal256) -> <Decimal256 as Mul>::Output
*
operation. Read more§impl Mul for Decimal256
impl Mul for Decimal256
§type Output = Decimal256
type Output = Decimal256
*
operator.§fn mul(self, other: Decimal256) -> Decimal256
fn mul(self, other: Decimal256) -> Decimal256
*
operation. Read more§impl MulAssign<&Decimal256> for Decimal256
impl MulAssign<&Decimal256> for Decimal256
§fn mul_assign(&mut self, other: &Decimal256)
fn mul_assign(&mut self, other: &Decimal256)
*=
operation. Read more§impl MulAssign for Decimal256
impl MulAssign for Decimal256
§fn mul_assign(&mut self, rhs: Decimal256)
fn mul_assign(&mut self, rhs: Decimal256)
*=
operation. Read more§impl Ord for Decimal256
impl Ord for Decimal256
§impl PartialEq<&Decimal256> for Decimal256
impl PartialEq<&Decimal256> for Decimal256
§impl<'a> PartialEq<Decimal256> for &'a Decimal256
impl<'a> PartialEq<Decimal256> for &'a Decimal256
§impl PartialEq for Decimal256
impl PartialEq for Decimal256
§fn eq(&self, other: &Decimal256) -> bool
fn eq(&self, other: &Decimal256) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialOrd for Decimal256
impl PartialOrd for Decimal256
§fn partial_cmp(&self, other: &Decimal256) -> Option<Ordering>
fn partial_cmp(&self, other: &Decimal256) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more§impl Rem<&Decimal256> for &Decimal256
impl Rem<&Decimal256> for &Decimal256
§type Output = <Decimal256 as Rem>::Output
type Output = <Decimal256 as Rem>::Output
%
operator.§fn rem(self, other: &Decimal256) -> <Decimal256 as Rem>::Output
fn rem(self, other: &Decimal256) -> <Decimal256 as Rem>::Output
%
operation. Read more§impl Rem<&Decimal256> for Decimal256
impl Rem<&Decimal256> for Decimal256
§type Output = <Decimal256 as Rem>::Output
type Output = <Decimal256 as Rem>::Output
%
operator.§fn rem(self, other: &Decimal256) -> <Decimal256 as Rem>::Output
fn rem(self, other: &Decimal256) -> <Decimal256 as Rem>::Output
%
operation. Read more§impl<'a> Rem<Decimal256> for &'a Decimal256
impl<'a> Rem<Decimal256> for &'a Decimal256
§type Output = <Decimal256 as Rem>::Output
type Output = <Decimal256 as Rem>::Output
%
operator.§fn rem(self, other: Decimal256) -> <Decimal256 as Rem>::Output
fn rem(self, other: Decimal256) -> <Decimal256 as Rem>::Output
%
operation. Read more§impl Rem for Decimal256
impl Rem for Decimal256
§fn rem(self, rhs: Decimal256) -> Decimal256
fn rem(self, rhs: Decimal256) -> Decimal256
§Panics
This operation will panic if rhs
is zero
§type Output = Decimal256
type Output = Decimal256
%
operator.§impl RemAssign<&Decimal256> for Decimal256
impl RemAssign<&Decimal256> for Decimal256
§fn rem_assign(&mut self, other: &Decimal256)
fn rem_assign(&mut self, other: &Decimal256)
%=
operation. Read more§impl RemAssign for Decimal256
impl RemAssign for Decimal256
§fn rem_assign(&mut self, rhs: Decimal256)
fn rem_assign(&mut self, rhs: Decimal256)
%=
operation. Read more§impl Serialize for Decimal256
impl Serialize for Decimal256
Serializes as a decimal string
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
§impl Sub<&Decimal256> for &Decimal256
impl Sub<&Decimal256> for &Decimal256
§type Output = <Decimal256 as Sub>::Output
type Output = <Decimal256 as Sub>::Output
-
operator.§fn sub(self, other: &Decimal256) -> <Decimal256 as Sub>::Output
fn sub(self, other: &Decimal256) -> <Decimal256 as Sub>::Output
-
operation. Read more§impl Sub<&Decimal256> for Decimal256
impl Sub<&Decimal256> for Decimal256
§type Output = <Decimal256 as Sub>::Output
type Output = <Decimal256 as Sub>::Output
-
operator.§fn sub(self, other: &Decimal256) -> <Decimal256 as Sub>::Output
fn sub(self, other: &Decimal256) -> <Decimal256 as Sub>::Output
-
operation. Read more§impl<'a> Sub<Decimal256> for &'a Decimal256
impl<'a> Sub<Decimal256> for &'a Decimal256
§type Output = <Decimal256 as Sub>::Output
type Output = <Decimal256 as Sub>::Output
-
operator.§fn sub(self, other: Decimal256) -> <Decimal256 as Sub>::Output
fn sub(self, other: Decimal256) -> <Decimal256 as Sub>::Output
-
operation. Read more§impl Sub for Decimal256
impl Sub for Decimal256
§type Output = Decimal256
type Output = Decimal256
-
operator.§fn sub(self, other: Decimal256) -> Decimal256
fn sub(self, other: Decimal256) -> Decimal256
-
operation. Read more§impl SubAssign<&Decimal256> for Decimal256
impl SubAssign<&Decimal256> for Decimal256
§fn sub_assign(&mut self, other: &Decimal256)
fn sub_assign(&mut self, other: &Decimal256)
-=
operation. Read more§impl SubAssign for Decimal256
impl SubAssign for Decimal256
§fn sub_assign(&mut self, rhs: Decimal256)
fn sub_assign(&mut self, rhs: Decimal256)
-=
operation. Read more§impl<A> Sum<A> for Decimal256
impl<A> Sum<A> for Decimal256
§fn sum<I>(iter: I) -> Decimal256where
I: Iterator<Item = A>,
fn sum<I>(iter: I) -> Decimal256where
I: Iterator<Item = A>,
Self
from the elements by
“summing up” the items.§impl TryFrom<SignedDecimal> for Decimal256
impl TryFrom<SignedDecimal> for Decimal256
§fn try_from(
value: SignedDecimal,
) -> Result<Decimal256, <Decimal256 as TryFrom<SignedDecimal>>::Error>
fn try_from( value: SignedDecimal, ) -> Result<Decimal256, <Decimal256 as TryFrom<SignedDecimal>>::Error>
§impl TryFrom<SignedDecimal256> for Decimal256
impl TryFrom<SignedDecimal256> for Decimal256
§fn try_from(
value: SignedDecimal256,
) -> Result<Decimal256, <Decimal256 as TryFrom<SignedDecimal256>>::Error>
fn try_from( value: SignedDecimal256, ) -> Result<Decimal256, <Decimal256 as TryFrom<SignedDecimal256>>::Error>
source§impl UnsignedDecimal for Decimal256
impl UnsignedDecimal for Decimal256
source§fn into_decimal256(self) -> Decimal256
fn into_decimal256(self) -> Decimal256
source§fn from_decimal256(src: Decimal256) -> Self
fn from_decimal256(src: Decimal256) -> Self
source§fn checked_add(self, rhs: Self) -> Result<Self, OverflowError>
fn checked_add(self, rhs: Self) -> Result<Self, OverflowError>
source§fn checked_add_signed(self, rhs: Signed<Self>) -> Result<Self>
fn checked_add_signed(self, rhs: Signed<Self>) -> Result<Self>
source§fn checked_sub(self, rhs: Self) -> Result<Self, OverflowError>
fn checked_sub(self, rhs: Self) -> Result<Self, OverflowError>
source§fn try_from_number(_: Signed<Decimal256>) -> Result<Self>
fn try_from_number(_: Signed<Decimal256>) -> Result<Self>
source§fn into_number(self) -> Signed<Decimal256>
fn into_number(self) -> Signed<Decimal256>
source§fn into_signed(self) -> Signed<Self>
fn into_signed(self) -> Signed<Self>
impl Copy for Decimal256
impl Eq for Decimal256
impl StructuralPartialEq for Decimal256
Auto Trait Implementations§
impl Freeze for Decimal256
impl RefUnwindSafe for Decimal256
impl Send for Decimal256
impl Sync for Decimal256
impl Unpin for Decimal256
impl UnwindSafe for Decimal256
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>,
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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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>
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>
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