pub struct Client<Inner> { /* fields omitted */ }
Expand description
Generic client implementation with common methods.
Implementations
impl<Inner, InnerErr> Client<Inner> where
Inner: Service<BoxRequest, Response = BoxResponse, Error = TransportError<InnerErr>> + Send + Clone + 'static,
Inner::Future: Send,
InnerErr: Error + Sync + Send + 'static,
impl<Inner, InnerErr> Client<Inner> where
Inner: Service<BoxRequest, Response = BoxResponse, Error = TransportError<InnerErr>> + Send + Clone + 'static,
Inner::Future: Send,
InnerErr: Error + Sync + Send + 'static,
Box the inner transport. This erases the type, making it easier to store the client in structures.
impl<Inner, InnerErr> Client<Inner> where
Inner: Service<BoxRequest, Response = BoxResponse, Error = TransportError<InnerErr>> + 'static,
InnerErr: 'static,
impl<Inner, InnerErr> Client<Inner> where
Inner: Service<BoxRequest, Response = BoxResponse, Error = TransportError<InnerErr>> + 'static,
InnerErr: 'static,
Layer this client with a new Layer
.
pub fn execute_request<Req, Resp>(
&mut self,
req: Request<Req>
) -> impl Future<Output = ClientResult<Response<Resp>, InnerErr>> + 'static where
Req: Message,
Resp: Message + Default,
pub fn execute_request<Req, Resp>(
&mut self,
req: Request<Req>
) -> impl Future<Output = ClientResult<Response<Resp>, InnerErr>> + 'static where
Req: Message,
Resp: Message + Default,
Executes a unary request and returns the decoded response.
pub fn connect_socket<Req, Resp>(
&mut self,
req: Request<()>
) -> impl Future<Output = ClientResult<Socket<Req, Resp>, InnerErr>> + 'static where
Req: Message,
Resp: Message + Default,
pub fn connect_socket<Req, Resp>(
&mut self,
req: Request<()>
) -> impl Future<Output = ClientResult<Socket<Req, Resp>, InnerErr>> + 'static where
Req: Message,
Resp: Message + Default,
Connect a socket with the server and return it.
pub fn connect_socket_req<Req, Resp>(
&mut self,
request: Request<Req>
) -> impl Future<Output = ClientResult<Socket<Req, Resp>, InnerErr>> + 'static where
Req: Message + Default + 'static,
Resp: Message + Default + 'static,
pub fn connect_socket_req<Req, Resp>(
&mut self,
request: Request<Req>
) -> impl Future<Output = ClientResult<Socket<Req, Resp>, InnerErr>> + 'static where
Req: Message + Default + 'static,
Resp: Message + Default + 'static,
Connect a socket with the server, send a message and return it.
Used by the server streaming methods.
Trait Implementations
Auto Trait Implementations
impl<Inner> RefUnwindSafe for Client<Inner> where
Inner: RefUnwindSafe,
impl<Inner> UnwindSafe for Client<Inner> where
Inner: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
Notable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
Notable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
pub fn vzip(self) -> V
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
Notable traits for WithDispatch<T>
impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
Notable traits for WithDispatch<T>
impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more