Struct barter_data::exchange::gateio::message::GateioMessage
source · pub struct GateioMessage<T> {
pub channel: String,
pub error: Option<GateioError>,
pub data: T,
}Expand description
Gateio WebSocket message.
Raw Payload Examples
Subscription Trades Success
See docs: https://www.gate.io/docs/developers/apiv4/ws/en/#api-overview
{
"time": 1606292218,
"time_ms": 1606292218231,
"channel": "spot.trades",
"event": "subscribe",
"result": {
"status": "success"
}
}
Subscription Trades Failure
See docs: https://www.gate.io/docs/developers/apiv4/ws/en/#api-overview
{
"time": 1606292218,
"time_ms": 1606292218231,
"channel": "spot.trades",
"event": "subscribe",
"error":{
"code":2,
"message":"unknown currency pair GIBBERISH_USD"
},
"result": null,
}
Spot Trade
See docs: https://www.gate.io/docs/developers/apiv4/ws/en/#public-trades-channel
{
"time": 1606292218,
"time_ms": 1606292218231,
"channel": "spot.trades",
"event": "update",
"result": {
"id": 309143071,
"create_time": 1606292218,
"create_time_ms": "1606292218213.4578",
"side": "sell",
"currency_pair": "GT_USDT",
"amount": "16.4700000000",
"price": "0.4705000000"
}
}
See docs: https://www.gate.io/docs/developers/apiv4/ws/en/#public-trades-channel
Fields§
§channel: String§error: Option<GateioError>§data: TTrait Implementations§
source§impl<T: Clone> Clone for GateioMessage<T>
impl<T: Clone> Clone for GateioMessage<T>
source§fn clone(&self) -> GateioMessage<T>
fn clone(&self) -> GateioMessage<T>
Returns a copy 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<T: Debug> Debug for GateioMessage<T>
impl<T: Debug> Debug for GateioMessage<T>
source§impl<'de, T> Deserialize<'de> for GateioMessage<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for GateioMessage<T>where
T: Deserialize<'de>,
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<T: Hash> Hash for GateioMessage<T>
impl<T: Hash> Hash for GateioMessage<T>
source§impl<T: Ord> Ord for GateioMessage<T>
impl<T: Ord> Ord for GateioMessage<T>
source§fn cmp(&self, other: &GateioMessage<T>) -> Ordering
fn cmp(&self, other: &GateioMessage<T>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<T: PartialEq> PartialEq<GateioMessage<T>> for GateioMessage<T>
impl<T: PartialEq> PartialEq<GateioMessage<T>> for GateioMessage<T>
source§fn eq(&self, other: &GateioMessage<T>) -> bool
fn eq(&self, other: &GateioMessage<T>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<T: PartialOrd> PartialOrd<GateioMessage<T>> for GateioMessage<T>
impl<T: PartialOrd> PartialOrd<GateioMessage<T>> for GateioMessage<T>
source§fn partial_cmp(&self, other: &GateioMessage<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &GateioMessage<T>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl<T> Serialize for GateioMessage<T>where
T: Serialize,
impl<T> Serialize for GateioMessage<T>where
T: Serialize,
impl<T: Eq> Eq for GateioMessage<T>
impl<T> StructuralEq for GateioMessage<T>
impl<T> StructuralPartialEq for GateioMessage<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for GateioMessage<T>where
T: RefUnwindSafe,
impl<T> Send for GateioMessage<T>where
T: Send,
impl<T> Sync for GateioMessage<T>where
T: Sync,
impl<T> Unpin for GateioMessage<T>where
T: Unpin,
impl<T> UnwindSafe for GateioMessage<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.