Struct googapis::google::example::showcase::v1beta1::echo_client::EchoClient [−][src]
pub struct EchoClient<T> { /* fields omitted */ }
Expand description
This service is used showcase the four main types of rpcs - unary, server side streaming, client side streaming, and bidirectional streaming. This service also exposes methods that explicitly implement server delay, and paginated calls. Set the ‘showcase-trailer’ metadata key on any method to have the values echoed in the response trailers.
Implementations
impl<T> EchoClient<T> where
T: GrpcService<BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> EchoClient<T> where
T: GrpcService<BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn with_interceptor<F>(
inner: T,
interceptor: F
) -> EchoClient<InterceptedService<T, F>> where
F: Interceptor,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
Compress requests with gzip
.
This requires the server to support it otherwise it might respond with an error.
Enable decompressing responses with gzip
.
pub async fn echo(
&mut self,
request: impl IntoRequest<EchoRequest>
) -> Result<Response<EchoResponse>, Status>
pub async fn echo(
&mut self,
request: impl IntoRequest<EchoRequest>
) -> Result<Response<EchoResponse>, Status>
This method simply echoes the request. This method showcases unary RPCs.
pub async fn expand(
&mut self,
request: impl IntoRequest<ExpandRequest>
) -> Result<Response<Streaming<EchoResponse>>, Status>
pub async fn expand(
&mut self,
request: impl IntoRequest<ExpandRequest>
) -> Result<Response<Streaming<EchoResponse>>, Status>
This method splits the given content into words and will pass each word back through the stream. This method showcases server-side streaming RPCs.
pub async fn collect(
&mut self,
request: impl IntoStreamingRequest<Message = EchoRequest>
) -> Result<Response<EchoResponse>, Status>
pub async fn collect(
&mut self,
request: impl IntoStreamingRequest<Message = EchoRequest>
) -> Result<Response<EchoResponse>, Status>
This method will collect the words given to it. When the stream is closed by the client, this method will return the a concatenation of the strings passed to it. This method showcases client-side streaming RPCs.
pub async fn chat(
&mut self,
request: impl IntoStreamingRequest<Message = EchoRequest>
) -> Result<Response<Streaming<EchoResponse>>, Status>
pub async fn chat(
&mut self,
request: impl IntoStreamingRequest<Message = EchoRequest>
) -> Result<Response<Streaming<EchoResponse>>, Status>
This method, upon receiving a request on the stream, will pass the same content back on the stream. This method showcases bidirectional streaming RPCs.
pub async fn paged_expand(
&mut self,
request: impl IntoRequest<PagedExpandRequest>
) -> Result<Response<PagedExpandResponse>, Status>
pub async fn paged_expand(
&mut self,
request: impl IntoRequest<PagedExpandRequest>
) -> Result<Response<PagedExpandResponse>, Status>
This is similar to the Expand method but instead of returning a stream of expanded words, this method returns a paged list of expanded words.
pub async fn wait(
&mut self,
request: impl IntoRequest<WaitRequest>
) -> Result<Response<Operation>, Status>
pub async fn wait(
&mut self,
request: impl IntoRequest<WaitRequest>
) -> Result<Response<Operation>, Status>
This method will wait for the requested amount of time and then return. This method showcases how a client handles a request timeout.
pub async fn block(
&mut self,
request: impl IntoRequest<BlockRequest>
) -> Result<Response<BlockResponse>, Status>
pub async fn block(
&mut self,
request: impl IntoRequest<BlockRequest>
) -> Result<Response<BlockResponse>, Status>
This method will block (wait) for the requested amount of time and then return the response or error. This method showcases how a client handles delays or retries.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for EchoClient<T> where
T: RefUnwindSafe,
impl<T> Send for EchoClient<T> where
T: Send,
impl<T> Sync for EchoClient<T> where
T: Sync,
impl<T> Unpin for EchoClient<T> where
T: Unpin,
impl<T> UnwindSafe for EchoClient<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Wrap the input message T
in a tonic::Request
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more