pub struct Quantity {
pub quantity_type: String,
pub value: Decimal,
}Expand description
An amount with its settlement mode (REST limits).
The settlement mode is the term in which the trade settles (for example T0, T1, T365).
§Examples
use brokapi_bcs_protocol::http::models::Quantity;
let q: Quantity = serde_json::from_str(r#"{"type":"T365","value":10}"#)?;
assert_eq!((q.quantity_type.as_str(), q.value), ("T365", dec!(10.0)));Fields§
§quantity_type: StringSettlement mode, such as T0 (JSON field type).
value: DecimalThe amount: pieces for quantity, lots for quantityBatch, money for a money limit.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Quantity
impl<'de> Deserialize<'de> for Quantity
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
Auto Trait Implementations§
impl Freeze for Quantity
impl RefUnwindSafe for Quantity
impl Send for Quantity
impl Sync for Quantity
impl Unpin for Quantity
impl UnsafeUnpin for Quantity
impl UnwindSafe for Quantity
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