pub struct Client<Inner> { /* private fields */ }
Expand description
Generic client implementation with common methods.
Implementations
sourceimpl<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,
sourcepub fn boxed(self) -> Client<BoxedTransport>
pub fn boxed(self) -> Client<BoxedTransport>
Box the inner transport. This erases the type, making it easier to store the client in structures.
sourceimpl<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,
sourcepub fn layer<S, L>(self, l: L) -> Client<S> where
L: Layer<Inner, Service = S>,
S: Service<BoxRequest>,
pub fn layer<S, L>(self, l: L) -> Client<S> where
L: Layer<Inner, Service = S>,
S: Service<BoxRequest>,
Layer this client with a new Layer
.
sourcepub 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.
sourcepub 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.
sourcepub 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> Send for Client<Inner> where
Inner: Send,
impl<Inner> Sync for Client<Inner> where
Inner: Sync,
impl<Inner> Unpin for Client<Inner> where
Inner: Unpin,
impl<Inner> UnwindSafe for Client<Inner> where
Inner: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn 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;
T: Future, type Output = <T as Future>::Output;
sourcefn 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;
T: Future, type Output = <T as Future>::Output;
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn 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>,
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn 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;
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more