pub struct OkxHttpApiLayer<F> { /* private fields */ }Expand description
Okx HTTP API layer.
Implementations§
Source§impl<F> OkxHttpApiLayer<F>
impl<F> OkxHttpApiLayer<F>
Sourcepub fn testing(&mut self, enable: bool) -> &mut Self
pub fn testing(&mut self, enable: bool) -> &mut Self
Set whether to use the testing environment.
Sourcepub fn retry<F2>(
self,
policy: RetryPolicy<HttpRequest, HttpResponse, F2>,
) -> OkxHttpApiLayer<F2>where
F2: Clone,
pub fn retry<F2>(
self,
policy: RetryPolicy<HttpRequest, HttpResponse, F2>,
) -> OkxHttpApiLayer<F2>where
F2: Clone,
Set retry policy.
Sourcepub fn retry_on<F2>(self, f: F2) -> OkxHttpApiLayer<F2>
pub fn retry_on<F2>(self, f: F2) -> OkxHttpApiLayer<F2>
Retry on true.
Sourcepub fn retry_on_error(self) -> OkxHttpApiLayer<fn(&ExchangeError) -> bool>
pub fn retry_on_error(self) -> OkxHttpApiLayer<fn(&ExchangeError) -> bool>
Always retry on errors.
Source§impl OkxHttpApiLayer<fn(&ExchangeError) -> bool>
impl OkxHttpApiLayer<fn(&ExchangeError) -> bool>
Trait Implementations§
Source§impl Default for OkxHttpApiLayer<fn(&ExchangeError) -> bool>
impl Default for OkxHttpApiLayer<fn(&ExchangeError) -> bool>
Source§impl<S, F> Layer<S> for OkxHttpApiLayer<F>
impl<S, F> Layer<S> for OkxHttpApiLayer<F>
Source§type Service = Retry<RetryPolicy<HttpRequest, HttpResponse, F>, OkxHttpApi<S>>
type Service = Retry<RetryPolicy<HttpRequest, HttpResponse, F>, OkxHttpApi<S>>
The wrapped service
Auto Trait Implementations§
impl<F> Freeze for OkxHttpApiLayer<F>where
F: Freeze,
impl<F> RefUnwindSafe for OkxHttpApiLayer<F>where
F: RefUnwindSafe,
impl<F> Send for OkxHttpApiLayer<F>where
F: Send,
impl<F> Sync for OkxHttpApiLayer<F>where
F: Sync,
impl<F> Unpin for OkxHttpApiLayer<F>where
F: Unpin,
impl<F> UnwindSafe for OkxHttpApiLayer<F>where
F: 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> 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