pub struct Transaction {
pub transaction_id: Uuid,
pub taker_order_id: OrderId,
pub maker_order_id: OrderId,
pub price: u64,
pub quantity: u64,
pub taker_side: Side,
pub timestamp: u64,
}Expand description
Represents a completed transaction between two orders
Fields§
§transaction_id: UuidUnique transaction ID
taker_order_id: OrderIdID of the aggressive order that caused the match
maker_order_id: OrderIdID of the passive order that was in the book
price: u64Price at which the transaction occurred
quantity: u64Quantity that was traded
taker_side: SideSide of the taker order
timestamp: u64Timestamp when the transaction occurred
Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn new(
transaction_id: Uuid,
taker_order_id: OrderId,
maker_order_id: OrderId,
price: u64,
quantity: u64,
taker_side: Side,
) -> Self
pub fn new( transaction_id: Uuid, taker_order_id: OrderId, maker_order_id: OrderId, price: u64, quantity: u64, taker_side: Side, ) -> Self
Create a new transaction
Sourcepub fn maker_side(&self) -> Side
pub fn maker_side(&self) -> Side
Returns the side of the maker order
Sourcepub fn total_value(&self) -> u64
pub fn total_value(&self) -> u64
Returns the total value of this transaction
Trait Implementations§
Source§impl Clone for Transaction
impl Clone for Transaction
Source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
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 Transaction
impl Debug for Transaction
Source§impl<'de> Deserialize<'de> for Transaction
impl<'de> Deserialize<'de> for Transaction
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 Transaction
impl Display for Transaction
Source§impl FromStr for Transaction
impl FromStr for Transaction
Source§impl PartialEq for Transaction
impl PartialEq for Transaction
Source§impl Serialize for Transaction
impl Serialize for Transaction
impl Copy for Transaction
impl StructuralPartialEq for Transaction
Auto Trait Implementations§
impl Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
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