[−][src]Enum nash_protocol::types::exchange::Rate
The Rate enum describes behavior common to rates/prices.
Variants
OrderRate(OrderRate)FeeRate(OrderRate)Implementations
impl Rate[src]
pub fn to_be_bytes(&self) -> Result<[u8; 8]>[src]
Convert any Rate into bytes for encoding in a Ethereum payload
pub fn from_be_bytes(bytes: [u8; 8]) -> Result<Self>[src]
Create Rate from big endian bytes in Ethereum FillOrder payload
impl Rate[src]
pub fn to_le_bytes(&self) -> Result<[u8; 8]>[src]
Convert any Rate into bytes for encoding in a NEO payload
impl Rate[src]
pub fn to_bigdecimal(&self) -> Result<BigDecimal>[src]
Return new bigdecimal inner value based on Rate
pub fn invert_rate(&self, precision: Option<u32>) -> Result<Self>[src]
pub fn subtract_fee(&self, fee: BigDecimal) -> Result<OrderRate>[src]
Subtract fee from user by adjusting the order rate downwards
Trait Implementations
impl Clone for Rate[src]
impl Debug for Rate[src]
impl From<OrderRate> for Rate[src]
Enum wrappers are kind of annoying. This allows us to use .into()
on a value to generate a wrapped value. For example:
OrderRate::new("1").unwrap().into() => Rate::OrderRate(...)
impl PartialEq<Rate> for Rate[src]
impl StructuralPartialEq for Rate[src]
Auto Trait Implementations
impl RefUnwindSafe for Rate
impl Send for Rate
impl Sync for Rate
impl Unpin for Rate
impl UnwindSafe for Rate
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> 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>,