pub struct MakeTickersOptions { /* private fields */ }
Expand description

Options for making a service to subscribe tickers.

Implementations§

source§

impl MakeTickersOptions

source

pub fn prefer_trade_bid_ask(self, flag: bool) -> Self

Set whether to prefer use ticker from trade bid/ask. Default is false.

source

pub fn first_trade(self, mode: FirstTrade) -> Self

Set how to get the first trade. Default is FirstTrade::Wait. Only works when MakeTickersOptions::prefer_trade_bid_ask is true.

source

pub fn is_prefer_trade_bid_ask(&self) -> bool

Get whether to prefer use ticker from trade bid/ask.

source

pub fn get_first_trade(&self) -> FirstTrade

Get how to get the first trade.

source

pub fn accept_bid_ask_ts(self, flag: bool) -> Self

Accept bid/ask ts. Default is false. Only works when MakeTickersOptions::prefer_trade_bid_ask is true.

source

pub fn is_accept_bid_ask_ts(&self) -> bool

Get whether to accept bid/ask ts.

Trait Implementations§

source§

impl Debug for MakeTickersOptions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for MakeTickersOptions

source§

fn default() -> MakeTickersOptions

Returns the “default value” for a type. Read more
source§

impl<M> Service<MakeTickersOptions> for AsService<'_, M>
where M: MakeTickers,

§

type Response = <M as MakeTickers>::Service

Responses given by the service.
§

type Error = ExchangeError

Errors produced by the service.
§

type Future = <M as MakeTickers>::Future

The future response value.
source§

fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
source§

fn call(&mut self, options: MakeTickersOptions) -> Self::Future

Process the request and return the response asynchronously. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.