pub struct Grpc<T> { /* private fields */ }Expand description
gRPC client handle.
Takes an HTTP service and adds the gRPC protocol.
Implementations§
Source§impl<T> Grpc<T>
impl<T> Grpc<T>
Sourcepub fn poll_ready<R>(&mut self) -> Poll<(), Status>where
T: GrpcService<R>,
pub fn poll_ready<R>(&mut self) -> Poll<(), Status>where
T: GrpcService<R>,
Returns Ready when the service is ready to accept a request.
Sourcepub fn ready<R>(self) -> impl Future<Item = Self, Error = Status>where
T: GrpcService<R>,
pub fn ready<R>(self) -> impl Future<Item = Self, Error = Status>where
T: GrpcService<R>,
Consumes self, returning a future that yields self back once it is ready to accept a
request.
Sourcepub fn unary<M1, M2, R>(
&mut self,
request: Request<M1>,
path: PathAndQuery,
) -> ResponseFuture<M2, T::Future, T::ResponseBody>
pub fn unary<M1, M2, R>( &mut self, request: Request<M1>, path: PathAndQuery, ) -> ResponseFuture<M2, T::Future, T::ResponseBody>
Send a unary gRPC request.
Sourcepub 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>,
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>,
Send a client streaing gRPC request.
Sourcepub fn server_streaming<M1, M2, R>(
&mut self,
request: Request<M1>,
path: PathAndQuery,
) -> ResponseFuture<M2, T::Future>
pub fn server_streaming<M1, M2, R>( &mut self, request: Request<M1>, path: PathAndQuery, ) -> ResponseFuture<M2, T::Future>
Send a server streaming gRPC request.
Sourcepub fn streaming<B, M, R>(
&mut self,
request: Request<B>,
path: PathAndQuery,
) -> ResponseFuture<M, T::Future>where
T: GrpcService<R>,
B: Encodable<R>,
pub fn streaming<B, M, R>(
&mut self,
request: Request<B>,
path: PathAndQuery,
) -> ResponseFuture<M, T::Future>where
T: GrpcService<R>,
B: Encodable<R>,
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§
Auto Trait Implementations§
impl<T> Freeze for Grpc<T>where
T: Freeze,
impl<T> RefUnwindSafe for Grpc<T>where
T: RefUnwindSafe,
impl<T> Send for Grpc<T>where
T: Send,
impl<T> Sync for Grpc<T>where
T: Sync,
impl<T> Unpin for Grpc<T>where
T: Unpin,
impl<T> UnwindSafe for Grpc<T>where
T: UnwindSafe,
Blanket Implementations§
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