pub struct MatchResult {
pub order_id: OrderId,
pub transactions: TransactionList,
pub remaining_quantity: u64,
pub is_complete: bool,
pub filled_order_ids: Vec<OrderId>,
}Expand description
Represents the result of a matching operation
Fields§
§order_id: OrderIdThe ID of the incoming order that initiated the match
transactions: TransactionListList of transactions that resulted from the match
remaining_quantity: u64Remaining quantity of the incoming order after matching
is_complete: boolWhether the order was completely filled
filled_order_ids: Vec<OrderId>Any orders that were completely filled and removed from the book
Implementations§
Source§impl MatchResult
impl MatchResult
Sourcepub fn add_transaction(&mut self, transaction: Transaction)
pub fn add_transaction(&mut self, transaction: Transaction)
Add a transaction to this match result
Sourcepub fn add_filled_order_id(&mut self, order_id: OrderId)
pub fn add_filled_order_id(&mut self, order_id: OrderId)
Add a filled order ID to track orders removed from the book
Sourcepub fn executed_quantity(&self) -> u64
pub fn executed_quantity(&self) -> u64
Get the total executed quantity
Sourcepub fn executed_value(&self) -> u64
pub fn executed_value(&self) -> u64
Get the total value executed
Sourcepub fn average_price(&self) -> Option<f64>
pub fn average_price(&self) -> Option<f64>
Calculate the average execution price
Trait Implementations§
Source§impl Clone for MatchResult
impl Clone for MatchResult
Source§fn clone(&self) -> MatchResult
fn clone(&self) -> MatchResult
Returns a duplicate 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 MatchResult
impl Debug for MatchResult
Source§impl<'de> Deserialize<'de> for MatchResult
impl<'de> Deserialize<'de> for MatchResult
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 Display for MatchResult
impl Display for MatchResult
Source§impl FromStr for MatchResult
impl FromStr for MatchResult
Auto Trait Implementations§
impl Freeze for MatchResult
impl RefUnwindSafe for MatchResult
impl Send for MatchResult
impl Sync for MatchResult
impl Unpin for MatchResult
impl UnwindSafe for MatchResult
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