pub struct EthereumAmount(pub U256);Expand description
Represents the amount of Ethereum in wei
Tuple Fields§
§0: U256Implementations§
Source§impl EthereumAmount
impl EthereumAmount
pub fn u256_from_str(val: &str) -> Result<U256, AmountError>
pub fn from_u256(wei: U256) -> Self
pub fn from_wei(wei_value: &str) -> Result<Self, AmountError>
pub fn from_kwei(kwei_value: &str) -> Result<Self, AmountError>
pub fn from_mwei(mwei_value: &str) -> Result<Self, AmountError>
pub fn from_gwei(gwei_value: &str) -> Result<Self, AmountError>
pub fn from_szabo(szabo_value: &str) -> Result<Self, AmountError>
pub fn from_finney(finney_value: &str) -> Result<Self, AmountError>
pub fn from_eth(eth_value: &str) -> Result<Self, AmountError>
pub fn add(self, b: Self) -> Self
pub fn sub(self, b: Self) -> Self
Trait Implementations§
Source§impl Clone for EthereumAmount
impl Clone for EthereumAmount
Source§fn clone(&self) -> EthereumAmount
fn clone(&self) -> EthereumAmount
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 Debug for EthereumAmount
impl Debug for EthereumAmount
Source§impl Display for EthereumAmount
impl Display for EthereumAmount
Source§impl Hash for EthereumAmount
impl Hash for EthereumAmount
Source§impl Ord for EthereumAmount
impl Ord for EthereumAmount
Source§fn cmp(&self, other: &EthereumAmount) -> Ordering
fn cmp(&self, other: &EthereumAmount) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for EthereumAmount
impl PartialEq for EthereumAmount
Source§impl PartialOrd for EthereumAmount
impl PartialOrd for EthereumAmount
Source§impl Serialize for EthereumAmount
impl Serialize for EthereumAmount
impl Amount for EthereumAmount
impl Copy for EthereumAmount
impl Eq for EthereumAmount
impl StructuralPartialEq for EthereumAmount
Auto Trait Implementations§
impl Freeze for EthereumAmount
impl RefUnwindSafe for EthereumAmount
impl Send for EthereumAmount
impl Sync for EthereumAmount
impl Unpin for EthereumAmount
impl UnwindSafe for EthereumAmount
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> 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