pub struct TradeBook {
pub trades: Vec<Trade>,
}Expand description
Trade book (list of all trades)
Fields§
§trades: Vec<Trade>List of trades
Implementations§
Source§impl TradeBook
impl TradeBook
Sourcepub fn total_value(&self) -> f64
pub fn total_value(&self) -> f64
Calculate total traded value
Sourcepub fn total_quantity(&self) -> u32
pub fn total_quantity(&self) -> u32
Calculate total quantity traded
Sourcepub fn trades_by_symbol(&self, symbol: &str) -> Vec<&Trade>
pub fn trades_by_symbol(&self, symbol: &str) -> Vec<&Trade>
Get trades by trading symbol
Sourcepub fn trades_by_type(&self, transaction_type: TransactionType) -> Vec<&Trade>
pub fn trades_by_type(&self, transaction_type: TransactionType) -> Vec<&Trade>
Get trades by transaction type
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TradeBook
impl<'de> Deserialize<'de> for TradeBook
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 TradeBook
impl RefUnwindSafe for TradeBook
impl Send for TradeBook
impl Sync for TradeBook
impl Unpin for TradeBook
impl UnwindSafe for TradeBook
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