[−][src]Enum merx::asset::asset::Asset
Can be either a Credit
or a Debt
Assets that wraps the same type can be added: a Debt
is always less then 0 and a Credit
is
always bigger or equal to 0, so only the addition is supported.
Assets can be multiplied or divided for i128
and TODO for floating point
Assets can be created from integer values or tuples TODO link
The value of an assets can be extract as an i128
or as a tuple TODO link
Variants
Debt(Debt<T>)
Credit(Credit<T>)
Methods
impl<T: CheckedOps> Asset<T>
[src]
impl<V: CheckedOps + TryFrom<i128>> Asset<V>
[src]
Trait Implementations
impl<T: CheckedOps> Add<Asset<T>> for Asset<T>
[src]
type Output = Option<Asset<T>>
The resulting type after applying the +
operator.
fn add(self, _rhs: Asset<T>) -> Self::Output
[src]
impl<T: Clone + CheckedOps> Clone for Asset<T>
[src]
impl<T: Copy + CheckedOps> Copy for Asset<T>
[src]
impl<T: Debug + CheckedOps> Debug for Asset<T>
[src]
impl<T: CheckedOps> Div<i128> for Asset<T>
[src]
type Output = Option<Asset<T>>
The resulting type after applying the /
operator.
fn div(self, rhs: i128) -> Self::Output
[src]
impl<T: Eq + CheckedOps> Eq for Asset<T>
[src]
impl<T: Hash + CheckedOps> Hash for Asset<T>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: CheckedOps> Mul<i128> for Asset<T>
[src]
type Output = Option<Asset<T>>
The resulting type after applying the *
operator.
fn mul(self, rhs: i128) -> Self::Output
[src]
impl<T: Ord + CheckedOps> Ord for Asset<T>
[src]
fn cmp(&self, other: &Asset<T>) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T: PartialEq + CheckedOps> PartialEq<Asset<T>> for Asset<T>
[src]
impl<T: PartialOrd + CheckedOps> PartialOrd<Asset<T>> for Asset<T>
[src]
fn partial_cmp(&self, other: &Asset<T>) -> Option<Ordering>
[src]
fn lt(&self, other: &Asset<T>) -> bool
[src]
fn le(&self, other: &Asset<T>) -> bool
[src]
fn gt(&self, other: &Asset<T>) -> bool
[src]
fn ge(&self, other: &Asset<T>) -> bool
[src]
impl<T: CheckedOps> StructuralEq for Asset<T>
[src]
impl<T: CheckedOps> StructuralPartialEq for Asset<T>
[src]
impl<I: TryInto<i128>, F: TryInto<u128>, T: TryFrom<(i128, F)> + CheckedOps> TryFrom<(I, F)> for Asset<T>
[src]
type Error = ()
The type returned in the event of a conversion error.
fn try_from(value: (I, F)) -> Result<Self, Self::Error>
[src]
impl<T: TryFrom<f64> + CheckedOps> TryFrom<f64> for Asset<T>
[src]
type Error = ()
The type returned in the event of a conversion error.
fn try_from(value: f64) -> Result<Self, Self::Error>
[src]
impl<T: TryFrom<i128> + CheckedOps> TryFrom<i128> for Asset<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Asset<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Asset<T> where
T: Send,
T: Send,
impl<T> Sync for Asset<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Asset<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Asset<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,