pub struct QuantityWithType {
pub settlement_type: String,
pub value: Decimal,
}Expand description
An amount together with its settlement mode.
The settlement mode (type) is the term in which the trade is settled, for example T0, T1 or
T365. The broker docs describe it and give no closed list.
§Examples
use brokapi_bcs_protocol::models::types::QuantityWithType;
let q: QuantityWithType = serde_json::from_str(r#"{"type":"T0","value":12.50}"#)?;
assert_eq!(q.settlement_type, "T0");
assert_eq!(q.value.to_string(), "12.50");Fields§
§settlement_type: StringSettlement mode, such as T0 (JSON field type).
value: DecimalThe amount, exactly as the broker wrote it.
Trait Implementations§
Source§impl Clone for QuantityWithType
impl Clone for QuantityWithType
Source§fn clone(&self) -> QuantityWithType
fn clone(&self) -> QuantityWithType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 QuantityWithType
impl Debug for QuantityWithType
Source§impl<'de> Deserialize<'de> for QuantityWithType
impl<'de> Deserialize<'de> for QuantityWithType
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 for QuantityWithType
impl PartialEq for QuantityWithType
Source§fn eq(&self, other: &QuantityWithType) -> bool
fn eq(&self, other: &QuantityWithType) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for QuantityWithType
impl Serialize for QuantityWithType
impl StructuralPartialEq for QuantityWithType
Auto Trait Implementations§
impl Freeze for QuantityWithType
impl RefUnwindSafe for QuantityWithType
impl Send for QuantityWithType
impl Sync for QuantityWithType
impl Unpin for QuantityWithType
impl UnsafeUnpin for QuantityWithType
impl UnwindSafe for QuantityWithType
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