| <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Definition of the gRPC trait alias for `tower_service`."><meta name="keywords" content="rust, rustlang, rust-lang, GrpcService"><title>GrpcService in tonic::client - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../tonic/index.html"><div class="logo-container"><img src="https://raw.githubusercontent.com/tokio-rs/website/master/public/img/icons/tonic.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../tonic/index.html"><div class="logo-container"> |
| <img src="https://raw.githubusercontent.com/tokio-rs/website/master/public/img/icons/tonic.svg" alt="logo"></div></a><h2 class="location"><a href="#">GrpcService</a></h2><div class="sidebar-elems"><section><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Error">Error</a></li><li><a href="#associatedtype.Future">Future</a></li><li><a href="#associatedtype.ResponseBody">ResponseBody</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.call">call</a></li><li><a href="#tymethod.poll_ready">poll_ready</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In tonic::client</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Trait <a href="../index.html">tonic</a>::<wbr><a href="index.html">client</a>::<wbr><a class="trait" href="#">GrpcService</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../../src/tonic/client/service.rs.html#13-30">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="item-decl"><pre class="rust trait"><code>pub trait GrpcService<ReqBody> { |
| type <a href="#associatedtype.ResponseBody" class="associatedtype">ResponseBody</a>: <a class="trait" href="../../http_body/trait.Body.html" title="trait http_body::Body">Body</a>; |
| type <a href="#associatedtype.Error" class="associatedtype">Error</a>: Into<Box<dyn Error + Send + Sync>>; |
| type <a href="#associatedtype.Future" class="associatedtype">Future</a>: Future<Output = Result<<a class="struct" href="../../http/response/struct.Response.html" title="struct http::response::Response">Response</a><Self::<a class="associatedtype" href="trait.GrpcService.html#associatedtype.ResponseBody" title="type tonic::client::GrpcService::ResponseBody">ResponseBody</a>>, Self::<a class="associatedtype" href="trait.GrpcService.html#associatedtype.Error" title="type tonic::client::GrpcService::Error">Error</a>>>; |
| |
| fn <a href="#tymethod.poll_ready" class="fnname">poll_ready</a>(<br> &mut self,<br> cx: &mut Context<'_><br> ) -> Poll<Result<(), Self::<a class="associatedtype" href="trait.GrpcService.html#associatedtype.Error" title="type tonic::client::GrpcService::Error">Error</a>>>; |
| <span class="item-spacer"></span> fn <a href="#tymethod.call" class="fnname">call</a>(&mut self, request: <a class="struct" href="../../http/request/struct.Request.html" title="struct http::request::Request">Request</a><ReqBody>) -> Self::<a class="associatedtype" href="trait.GrpcService.html#associatedtype.Future" title="type tonic::client::GrpcService::Future">Future</a>; |
| }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Definition of the gRPC trait alias for <a href="https://docs.rs/tower-service"><code>tower_service</code></a>.</p> |
| <p>This trait enforces that all tower services provided to <a href="../client/struct.Grpc.html"><code>Grpc</code></a> implements |
| the correct traits.</p> |
| </div></details><h2 id="required-associated-types" class="small-section-header">Required Associated Types<a href="#required-associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle method-toggle" open><summary><section id="associatedtype.ResponseBody" class="method has-srclink"><a class="srclink rightside" href="../../src/tonic/client/service.rs.html#15">source</a><h4 class="code-header">type <a href="#associatedtype.ResponseBody" class="associatedtype">ResponseBody</a>: <a class="trait" href="../../http_body/trait.Body.html" title="trait http_body::Body">Body</a></h4></section></summary><div class="docblock"><p>Responses body given by the service.</p> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="associatedtype.Error" class="method has-srclink"><a class="srclink rightside" href="../../src/tonic/client/service.rs.html#17">source</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a>: Into<Box<dyn Error + Send + Sync>></h4></section></summary><div class="docblock"><p>Errors produced by the service.</p> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="associatedtype.Future" class="method has-srclink"><a class="srclink rightside" href="../../src/tonic/client/service.rs.html#19">source</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a>: Future<Output = Result<<a class="struct" href="../../http/response/struct.Response.html" title="struct http::response::Response">Response</a><Self::<a class="associatedtype" href="trait.GrpcService.html#associatedtype.ResponseBody" title="type tonic::client::GrpcService::ResponseBody">ResponseBody</a>>, Self::<a class="associatedtype" href="trait.GrpcService.html#associatedtype.Error" title="type tonic::client::GrpcService::Error">Error</a>>></h4></section></summary><div class="docblock"><p>The future response value.</p> |
| </div></details></div><h2 id="required-methods" class="small-section-header">Required Methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.poll_ready" class="method has-srclink"><a class="srclink rightside" href="../../src/tonic/client/service.rs.html#24">source</a><h4 class="code-header">fn <a href="#tymethod.poll_ready" class="fnname">poll_ready</a>(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::<a class="associatedtype" href="trait.GrpcService.html#associatedtype.Error" title="type tonic::client::GrpcService::Error">Error</a>>></h4></section></summary><div class="docblock"><p>Returns <code>Ready</code> when the service is able to process requests.</p> |
| <p>Reference <a href="../../tower_service/trait.Service.html#tymethod.poll_ready" title="Service::poll_ready"><code>Service::poll_ready</code></a>.</p> |
| </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.call" class="method has-srclink"><a class="srclink rightside" href="../../src/tonic/client/service.rs.html#29">source</a><h4 class="code-header">fn <a href="#tymethod.call" class="fnname">call</a>(&mut self, request: <a class="struct" href="../../http/request/struct.Request.html" title="struct http::request::Request">Request</a><ReqBody>) -> Self::<a class="associatedtype" href="trait.GrpcService.html#associatedtype.Future" title="type tonic::client::GrpcService::Future">Future</a></h4></section></summary><div class="docblock"><p>Process the request and return the response asynchronously.</p> |
| <p>Reference <a href="../../tower_service/trait.Service.html#tymethod.call" title="Service::call"><code>Service::call</code></a>.</p> |
| </div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div id="implementors-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-GrpcService%3CReqBody%3E-for-T" class="impl has-srclink"><a class="srclink rightside" href="../../src/tonic/client/service.rs.html#32-50">source</a><a href="#impl-GrpcService%3CReqBody%3E-for-T" class="anchor"></a><h3 class="code-header">impl<T, ReqBody, ResBody> <a class="trait" href="trait.GrpcService.html" title="trait tonic::client::GrpcService">GrpcService</a><ReqBody> for T<span class="where fmt-newline">where<br> T: <a class="trait" href="../../tower_service/trait.Service.html" title="trait tower_service::Service">Service</a><<a class="struct" href="../../http/request/struct.Request.html" title="struct http::request::Request">Request</a><ReqBody>, Response = <a class="struct" href="../../http/response/struct.Response.html" title="struct http::response::Response">Response</a><ResBody>>,<br> T::<a class="associatedtype" href="../../tower_service/trait.Service.html#associatedtype.Error" title="type tower_service::Service::Error">Error</a>: Into<Box<dyn Error + Send + Sync>>,<br> ResBody: <a class="trait" href="../../http_body/trait.Body.html" title="trait http_body::Body">Body</a>,<br> <ResBody as <a class="trait" href="../../http_body/trait.Body.html" title="trait http_body::Body">Body</a>>::<a class="associatedtype" href="../../http_body/trait.Body.html#associatedtype.Error" title="type http_body::Body::Error">Error</a>: Into<Box<dyn Error + Send + Sync>>,</span></h3></section></summary><div class="impl-items"><section id="associatedtype.ResponseBody-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.ResponseBody-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.ResponseBody" class="associatedtype">ResponseBody</a> = ResBody</h4></section><section id="associatedtype.Error-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = <T as <a class="trait" href="../../tower_service/trait.Service.html" title="trait tower_service::Service">Service</a><<a class="struct" href="../../http/request/struct.Request.html" title="struct http::request::Request">Request</a><ReqBody>>>::<a class="associatedtype" href="../../tower_service/trait.Service.html#associatedtype.Error" title="type tower_service::Service::Error">Error</a></h4></section><section id="associatedtype.Future-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Future-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <T as <a class="trait" href="../../tower_service/trait.Service.html" title="trait tower_service::Service">Service</a><<a class="struct" href="../../http/request/struct.Request.html" title="struct http::request::Request">Request</a><ReqBody>>>::<a class="associatedtype" href="../../tower_service/trait.Service.html#associatedtype.Future" title="type tower_service::Service::Future">Future</a></h4></section></div></details></div><script src="../../implementors/tonic/client/service/trait.GrpcService.js" async></script></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="tonic" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html> |