Struct ex3_node_types::transaction::OrderPriceLimitation
source · pub struct OrderPriceLimitation {
pub bid_price_rate_cap: BigUint,
pub ask_price_rate_floor: BigUint,
pub rate_decimal: u8,
}Expand description
Orderbook price limitation
Example
use std::ops::Mul;
use num_bigint::BigUint;
use ex3_node_types::transaction::OrderPriceLimitation;
let latest_order_price: BigUint = BigUint::from(1000000000u32);
let order_price_limitation = OrderPriceLimitation {
bid_price_rate_cap: BigUint::from(300000000u32),
ask_price_rate_floor: BigUint::from(20000000u32),
rate_decimal: 8,
};
let real_bid_price_rate_cap = order_price_limitation.bid_price_rate_cap.clone()
/ BigUint::from(10u32.pow(order_price_limitation.rate_decimal.clone() as u32));
assert_eq!(real_bid_price_rate_cap, BigUint::from(3u32));Fields§
§bid_price_rate_cap: BigUintOrderbook biding price rate cap
ask_price_rate_floor: BigUintOrderbook asking price rate floor
rate_decimal: u8Price rate decimal
Trait Implementations§
source§impl Clone for OrderPriceLimitation
impl Clone for OrderPriceLimitation
source§fn clone(&self) -> OrderPriceLimitation
fn clone(&self) -> OrderPriceLimitation
Returns a copy 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 OrderPriceLimitation
impl Debug for OrderPriceLimitation
source§impl<'de> Deserialize<'de> for OrderPriceLimitation
impl<'de> Deserialize<'de> for OrderPriceLimitation
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<OrderPriceLimitation> for OrderPriceLimitation
impl PartialEq<OrderPriceLimitation> for OrderPriceLimitation
source§fn eq(&self, other: &OrderPriceLimitation) -> bool
fn eq(&self, other: &OrderPriceLimitation) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for OrderPriceLimitation
impl Serialize for OrderPriceLimitation
impl Eq for OrderPriceLimitation
impl StructuralEq for OrderPriceLimitation
impl StructuralPartialEq for OrderPriceLimitation
Auto Trait Implementations§
impl RefUnwindSafe for OrderPriceLimitation
impl Send for OrderPriceLimitation
impl Sync for OrderPriceLimitation
impl Unpin for OrderPriceLimitation
impl UnwindSafe for OrderPriceLimitation
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