pub struct TradeResponse {
pub topic: String,
pub message_type: String,
pub ts: u64,
pub data: Vec<TradeData>,
}Expand description
Bybit Futures trade message response from WebSocket
Fields§
§topic: StringTopic being subscribed to (e.g., “publicTrade.BTCUSDT”)
message_type: StringType of message (e.g., “snapshot” or “delta”)
ts: u64Timestamp in milliseconds (from Bybit server)
data: Vec<TradeData>Trade data
Implementations§
Source§impl TradeResponse
Implementation of TradeResponse
impl TradeResponse
Implementation of TradeResponse
Sourcepub fn price_decimal(&self) -> Option<Decimal>
pub fn price_decimal(&self) -> Option<Decimal>
Convert to Rust Decimal for price
Sourcepub fn size_decimal(&self) -> Option<Decimal>
pub fn size_decimal(&self) -> Option<Decimal>
Convert to Rust Decimal for size/quantity
Sourcepub const fn timestamp_ns(&self) -> u64
pub const fn timestamp_ns(&self) -> u64
Get the trade timestamp in nanoseconds
Trait Implementations§
Source§impl Clone for TradeResponse
impl Clone for TradeResponse
Source§fn clone(&self) -> TradeResponse
fn clone(&self) -> TradeResponse
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TradeResponse
impl Debug for TradeResponse
Source§impl<'de> Deserialize<'de> for TradeResponse
impl<'de> Deserialize<'de> for TradeResponse
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 TradeResponse
impl RefUnwindSafe for TradeResponse
impl Send for TradeResponse
impl Sync for TradeResponse
impl Unpin for TradeResponse
impl UnwindSafe for TradeResponse
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