Struct barter_data::exchange::bybit::Bybit
source · pub struct Bybit<Server> { /* private fields */ }Expand description
Generic Bybit<Server> exchange.
§Notes
A Server ExchangeServer implementations exists for
BybitSpot and BybitFuturesUsd.
Trait Implementations§
source§impl<Server> Connector for Bybit<Server>where
Server: ExchangeServer,
impl<Server> Connector for Bybit<Server>where
Server: ExchangeServer,
source§const ID: ExchangeId = Server::ID
const ID: ExchangeId = Server::ID
Unique identifier for the exchange server being connected with.
§type Channel = BybitChannel
type Channel = BybitChannel
Type that defines how to translate a Barter
Subscription into an exchange specific channel
to be subscribed to. Read more§type Market = BybitMarket
type Market = BybitMarket
Type that defines how to translate a Barter
Subscription into an exchange specific market that
can be subscribed to. Read more§type Subscriber = WebSocketSubscriber
type Subscriber = WebSocketSubscriber
Subscriber type that establishes a connection with the exchange server, and actions
Subscriptions over the socket.§type SubValidator = WebSocketSubValidator
type SubValidator = WebSocketSubValidator
SubscriptionValidator type that listens to responses from the exchange server and
validates if the actioned Subscriptions were
successful.§type SubResponse = BybitResponse
type SubResponse = BybitResponse
Deserialisable type that the
Self::SubValidator expects to receive from the exchange server in
response to the Subscription Self::requests
sent over the WebSocket. Implements
Validator in order to determine if Self
communicates a successful Subscription outcome.source§fn ping_interval() -> Option<PingInterval>
fn ping_interval() -> Option<PingInterval>
Defines
PingInterval of custom application-level
WebSocket pings for the exchange
server being connected with. Read moresource§fn requests(
exchange_subs: Vec<ExchangeSub<Self::Channel, Self::Market>>,
) -> Vec<WsMessage>
fn requests( exchange_subs: Vec<ExchangeSub<Self::Channel, Self::Market>>, ) -> Vec<WsMessage>
Defines how to translate a collection of
ExchangeSubs into the WsMessage
subscription payloads sent to the exchange server.source§fn expected_responses<InstrumentId>(_: &Map<InstrumentId>) -> usize
fn expected_responses<InstrumentId>(_: &Map<InstrumentId>) -> usize
Number of
Subscription responses expected from the
exchange server in responses to the requests send. Used to validate all
Subscriptions were accepted.source§fn subscription_timeout() -> Duration
fn subscription_timeout() -> Duration
Expected
Duration the SubscriptionValidator will wait to receive all success
responses to actioned Subscription requests.source§impl<'de, Server> Deserialize<'de> for Bybit<Server>where
Server: ExchangeServer,
impl<'de, Server> Deserialize<'de> for Bybit<Server>where
Server: ExchangeServer,
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<Server: Ord> Ord for Bybit<Server>
impl<Server: Ord> Ord for Bybit<Server>
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<Server: PartialEq> PartialEq for Bybit<Server>
impl<Server: PartialEq> PartialEq for Bybit<Server>
source§impl<Server: PartialOrd> PartialOrd for Bybit<Server>
impl<Server: PartialOrd> PartialOrd for Bybit<Server>
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<Server> Serialize for Bybit<Server>where
Server: ExchangeServer,
impl<Server> Serialize for Bybit<Server>where
Server: ExchangeServer,
source§impl<Instrument, Server> StreamSelector<Instrument, PublicTrades> for Bybit<Server>
impl<Instrument, Server> StreamSelector<Instrument, PublicTrades> for Bybit<Server>
type Stream = ExchangeStream<WebSocketParser, SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>>, StatelessTransformer<Bybit<Server>, <Instrument as InstrumentData>::Id, PublicTrades, BybitMessage>>
impl<Server: Copy> Copy for Bybit<Server>
impl<Server: Eq> Eq for Bybit<Server>
impl<Server> StructuralPartialEq for Bybit<Server>
Auto Trait Implementations§
impl<Server> Freeze for Bybit<Server>
impl<Server> RefUnwindSafe for Bybit<Server>where
Server: RefUnwindSafe,
impl<Server> Send for Bybit<Server>where
Server: Send,
impl<Server> Sync for Bybit<Server>where
Server: Sync,
impl<Server> Unpin for Bybit<Server>where
Server: Unpin,
impl<Server> UnwindSafe for Bybit<Server>where
Server: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more