pub struct Okx { /* private fields */ }
Expand description
Okx API.
Implementations§
Trait Implementations§
source§impl Service<OkxRequest> for Okx
impl Service<OkxRequest> for Okx
§type Response = OkxResponse
type Response = OkxResponse
Responses given by the service.
§type Error = ExchangeError
type Error = ExchangeError
Errors produced by the service.
§type Future = Pin<Box<dyn Future<Output = Result<<Okx as Service<OkxRequest>>::Response, <Okx as Service<OkxRequest>>::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<Okx as Service<OkxRequest>>::Response, <Okx as Service<OkxRequest>>::Error>> + Send>>
The future response value.
source§fn poll_ready(
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<(), <Okx as Service<OkxRequest>>::Error>>
fn poll_ready( &mut self, cx: &mut Context<'_> ) -> Poll<Result<(), <Okx as Service<OkxRequest>>::Error>>
Returns
Poll::Ready(Ok(()))
when the service is able to process requests. Read moresource§fn call(&mut self, req: OkxRequest) -> <Okx as Service<OkxRequest>>::Future
fn call(&mut self, req: OkxRequest) -> <Okx as Service<OkxRequest>>::Future
Process the request and return the response asynchronously. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for Okx
impl Send for Okx
impl Sync for Okx
impl Unpin for Okx
impl !UnwindSafe for Okx
Blanket Implementations§
§impl<C, Req, R> AdaptService<Req, R> for C
impl<C, Req, R> AdaptService<Req, R> for C
§type AdaptedResponse = AndThen<<C as ExcService<Req>>::Future, fn(_: <Req as Request>::Response) -> Result<<R as Request>::Response, ExchangeError>>
type AdaptedResponse = AndThen<<C as ExcService<Req>>::Future, fn(_: <Req as Request>::Response) -> Result<<R as Request>::Response, ExchangeError>>
Future returned by [
AdaptService::into_response
].§fn adapt_from_request(&mut self, req: R) -> Result<Req, ExchangeError>
fn adapt_from_request(&mut self, req: R) -> Result<Req, ExchangeError>
Adapt the request.
§fn adapt_into_response(
&mut self,
res: <C as ExcService<Req>>::Future
) -> <C as AdaptService<Req, R>>::AdaptedResponse
fn adapt_into_response( &mut self, res: <C as ExcService<Req>>::Future ) -> <C as AdaptService<Req, R>>::AdaptedResponse
Adapt the response future
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
§impl<S, R> ExcServiceExt<R> for Swhere
S: ExcService<R>,
R: Request,
impl<S, R> ExcServiceExt<R> for Swhere
S: ExcService<R>,
R: Request,
§fn into_service(self) -> IntoService<Self, R>where
Self: Sized,
fn into_service(self) -> IntoService<Self, R>where
Self: Sized,
Convert into a [
Service
].§fn apply<L, R2>(self, layer: &L) -> <L as Layer<Self>>::Service
fn apply<L, R2>(self, layer: &L) -> <L as Layer<Self>>::Service
Apply a layer of which the result service is still a
ExcService
.§fn rate_limited(
self,
num: u64,
per: Duration
) -> RateLimit<IntoService<Self, R>>where
Self: Sized,
fn rate_limited(
self,
num: u64,
per: Duration
) -> RateLimit<IntoService<Self, R>>where
Self: Sized,
Apply a rate-limit layer to the service.
§fn retry(self, max_duration: Duration) -> Retry<Always, IntoService<Self, R>>
fn retry(self, max_duration: Duration) -> Retry<Always, IntoService<Self, R>>
Apply a retry layer to the service.
§fn boxed(self) -> BoxExcService<R>
fn boxed(self) -> BoxExcService<R>
Create a boxed
ExcService
.§fn boxed_clone(&self) -> BoxCloneExcService<R>
fn boxed_clone(&self) -> BoxCloneExcService<R>
Create a boxed
ExcService
with Clone
.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>
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T, Request> ServiceExt<Request> for Twhere
T: Service<Request> + ?Sized,
impl<T, Request> ServiceExt<Request> for Twhere
T: Service<Request> + ?Sized,
source§fn ready(&mut self) -> Ready<'_, Self, Request>where
Self: Sized,
fn ready(&mut self) -> Ready<'_, Self, Request>where
Self: Sized,
Yields a mutable reference to the service when it is ready to accept a request.
source§fn ready_and(&mut self) -> Ready<'_, Self, Request>where
Self: Sized,
fn ready_and(&mut self) -> Ready<'_, Self, Request>where
Self: Sized,
👎Deprecated since 0.4.6: please use the
ServiceExt::ready
method insteadYields a mutable reference to the service when it is ready to accept a request.
source§fn ready_oneshot(self) -> ReadyOneshot<Self, Request>where
Self: Sized,
fn ready_oneshot(self) -> ReadyOneshot<Self, Request>where
Self: Sized,
Yields the service when it is ready to accept a request.
source§fn oneshot(self, req: Request) -> Oneshot<Self, Request>where
Self: Sized,
fn oneshot(self, req: Request) -> Oneshot<Self, Request>where
Self: Sized,
Consume this
Service
, calling with the providing request once it is ready.source§fn and_then<F>(self, f: F) -> AndThen<Self, F>
fn and_then<F>(self, f: F) -> AndThen<Self, F>
Executes a new future after this service’s future resolves. This does
not alter the behaviour of the
poll_ready
method. Read moresource§fn map_response<F, Response>(self, f: F) -> MapResponse<Self, F>
fn map_response<F, Response>(self, f: F) -> MapResponse<Self, F>
Maps this service’s response value to a different value. This does not
alter the behaviour of the
poll_ready
method. Read moresource§fn map_err<F, Error>(self, f: F) -> MapErr<Self, F>
fn map_err<F, Error>(self, f: F) -> MapErr<Self, F>
Maps this service’s error value to a different value. This does not
alter the behaviour of the
poll_ready
method. Read moresource§fn map_result<F, Response, Error>(self, f: F) -> MapResult<Self, F>
fn map_result<F, Response, Error>(self, f: F) -> MapResult<Self, F>
Maps this service’s result type (
Result<Self::Response, Self::Error>
)
to a different value, regardless of whether the future succeeds or
fails. Read moresource§fn map_request<F, NewRequest>(self, f: F) -> MapRequest<Self, F>
fn map_request<F, NewRequest>(self, f: F) -> MapRequest<Self, F>
Composes a function in front of the service. Read more
source§fn then<F, Response, Error, Fut>(self, f: F) -> Then<Self, F>
fn then<F, Response, Error, Fut>(self, f: F) -> Then<Self, F>
Composes an asynchronous function after this service. Read more
source§fn map_future<F, Fut, Response, Error>(self, f: F) -> MapFuture<Self, F>
fn map_future<F, Fut, Response, Error>(self, f: F) -> MapFuture<Self, F>
Composes a function that transforms futures produced by the service. Read more