[−][src]Struct nash_protocol::types::exchange::Amount
Amount encodes the amount of asset being bought or sold in an order It is encoded with a precision that depends on the market and asset being traded. For example, in the ETH/USD market, ETH has a precision of 4. In an A/B market, amount is always in units of A.
Fields
precision: u32value: BigDecimalImplementations
impl Amount[src]
pub fn to_be_bytes(&self) -> Result<[u8; 8]>[src]
Serialize Amount to Big Endian bytes for ETH payload creation.
pub fn from_bytes(bytes: [u8; 8], precision: u32) -> Result<Self>[src]
Create an amount of given precision from ETH payload bytes
impl Amount[src]
pub fn to_le_bytes(&self) -> Result<[u8; 8]>[src]
Serialize Amount to Little Endian bytes for NEO payload creation.
impl Amount[src]
pub fn new(str_num: &str, precision: u32) -> Result<Self>[src]
Construct a new Amount from string and precision
pub fn from_bigdecimal(value: BigDecimal, precision: u32) -> Self[src]
pub fn to_bigdecimal(&self) -> BigDecimal[src]
Trait Implementations
impl Clone for Amount[src]
impl Debug for Amount[src]
impl<'de> Deserialize<'de> for Amount[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
impl Eq for Amount[src]
impl PartialEq<Amount> for Amount[src]
impl Serialize for Amount[src]
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer, [src]
__S: Serializer,
impl StructuralEq for Amount[src]
impl StructuralPartialEq for Amount[src]
Auto Trait Implementations
impl RefUnwindSafe for Amount
impl Send for Amount
impl Sync for Amount
impl Unpin for Amount
impl UnwindSafe for Amount
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,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool[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> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub 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.
pub 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>,