Struct tokio_tower::pipeline::client::Client [−][src]
Expand description
This type provides an implementation of a Tower
Service
on top of a
request-at-a-time protocol transport. In particular, it wraps a transport that implements
Sink<SinkItem = Request>
and Stream<Item = Response>
with the necessary bookkeeping to
adhere to Tower’s convenient fn(Request) -> Future<Response>
API.
Implementations
Construct a new Client
over the given transport
.
If the Client errors, the error is dropped when new
is used – use with_error_handler
to handle such an error explicitly.
pub fn with_error_handler<F>(transport: T, on_service_error: F) -> Self where
F: FnOnce(E) + Send + 'static,
pub fn with_error_handler<F>(transport: T, on_service_error: F) -> Self where
F: FnOnce(E) + Send + 'static,
Construct a new Client
over the given transport
.
If the Client
errors, its error is passed to on_service_error
.
Trait Implementations
Auto Trait Implementations
impl<T, E, Request> !RefUnwindSafe for Client<T, E, Request>
impl<T, E, Request> !UnwindSafe for Client<T, E, Request>
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
impl<M, T, Target, Request> MakeTransport<Target, Request> for M where
M: Service<Target, Response = T>,
T: TryStream + Sink<Request>,
impl<M, T, Target, Request> MakeTransport<Target, Request> for M where
M: Service<Target, Response = T>,
T: TryStream + Sink<Request>,
type Transport = T
type Transport = T
The Sink + Stream
implementation created by this factory
pub fn poll_ready(
&mut Self,
&mut Context<'_>
) -> Poll<Result<(), <M as MakeTransport<Target, Request>>::MakeError>>
pub fn poll_ready(
&mut Self,
&mut Context<'_>
) -> Poll<Result<(), <M as MakeTransport<Target, Request>>::MakeError>>
Returns Ready
when the factory is able to create more transports. Read more
Create and return a new transport asynchronously.