[][src]Struct tower_grpc::client::Grpc

pub struct Grpc<T> { /* fields omitted */ }

gRPC client handle.

Takes an HTTP service and adds the gRPC protocol.

Methods

impl<T> Grpc<T>[src]

pub fn new(inner: T) -> Self[src]

Create a new Grpc instance backed by the given HTTP service.

pub fn poll_ready<R>(&mut self) -> Poll<(), Status> where
    T: GrpcService<R>, 
[src]

Returns Ready when the service is ready to accept a request.

pub fn ready<R>(self) -> impl Future<Item = Self, Error = Status> where
    T: GrpcService<R>, 
[src]

Consumes self, returning a future that yields self back once it is ready to accept a request.

pub fn unary<M1, M2, R>(
    &mut self,
    request: Request<M1>,
    path: PathAndQuery
) -> ResponseFuture<M2, T::Future, T::ResponseBody> where
    T: GrpcService<R>,
    Once<M1>: Encodable<R>, 
[src]

Send a unary gRPC request.

pub fn client_streaming<B, M, R>(
    &mut self,
    request: Request<B>,
    path: PathAndQuery
) -> ResponseFuture<M, T::Future, T::ResponseBody> where
    T: GrpcService<R>,
    B: Encodable<R>, 
[src]

Send a client streaing gRPC request.

pub fn server_streaming<M1, M2, R>(
    &mut self,
    request: Request<M1>,
    path: PathAndQuery
) -> ResponseFuture<M2, T::Future> where
    T: GrpcService<R>,
    Once<M1>: Encodable<R>, 
[src]

Send a server streaming gRPC request.

pub fn streaming<B, M, R>(
    &mut self,
    request: Request<B>,
    path: PathAndQuery
) -> ResponseFuture<M, T::Future> where
    T: GrpcService<R>,
    B: Encodable<R>, 
[src]

Initiate a full streaming gRPC request

Generics

B: The request stream of gRPC message values. M: The response message (not stream) type. R: The type of the request body.

Trait Implementations

impl<T: Clone> Clone for Grpc<T>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for Grpc<T>[src]

Auto Trait Implementations

impl<T> Unpin for Grpc<T> where
    T: Unpin

impl<T> Sync for Grpc<T> where
    T: Sync

impl<T> Send for Grpc<T> where
    T: Send

impl<T> UnwindSafe for Grpc<T> where
    T: UnwindSafe

impl<T> RefUnwindSafe for Grpc<T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]