pub struct AggTrade {
pub agg_id: i64,
pub price: Decimal,
pub quantity: Decimal,
pub first_trade_id: i64,
pub last_trade_id: i64,
pub timestamp: i64,
pub is_buyer_maker: bool,
pub is_best_match: Option<bool>,
pub symbol: Option<String>,
}Expand description
Aggregated trade data structure.
Fields§
§agg_id: i64Aggregated trade ID
price: DecimalTrade price
quantity: DecimalTrade quantity
first_trade_id: i64First trade ID in aggregation
last_trade_id: i64Last trade ID in aggregation
timestamp: i64Trade timestamp in milliseconds
is_buyer_maker: boolWhether buyer is the maker
is_best_match: Option<bool>Whether trade was at best price match
symbol: Option<String>Trading pair symbol (added for convenience, not native to Binance API)
Implementations§
Source§impl AggTrade
impl AggTrade
Sourcepub fn new(
agg_id: i64,
price: Decimal,
quantity: Decimal,
first_trade_id: i64,
last_trade_id: i64,
timestamp: i64,
is_buyer_maker: bool,
) -> AggTrade
pub fn new( agg_id: i64, price: Decimal, quantity: Decimal, first_trade_id: i64, last_trade_id: i64, timestamp: i64, is_buyer_maker: bool, ) -> AggTrade
Creates a new aggregated trade instance.
§Arguments
agg_id- Aggregated trade IDprice- Trade pricequantity- Trade quantityfirst_trade_id- First trade ID in aggregationlast_trade_id- Last trade ID in aggregationtimestamp- Trade timestamp in millisecondsis_buyer_maker- Whether buyer is the maker
Sourcepub fn trade_count(&self) -> i64
pub fn trade_count(&self) -> i64
Returns the number of trades included in this aggregation.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AggTrade
impl<'de> Deserialize<'de> for AggTrade
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AggTrade, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AggTrade, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for AggTrade
impl Serialize for AggTrade
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for AggTrade
impl RefUnwindSafe for AggTrade
impl Send for AggTrade
impl Sync for AggTrade
impl Unpin for AggTrade
impl UnwindSafe for AggTrade
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