Home
last modified time | relevance | path

Searched refs:T (Results 1 – 25 of 56) sorted by relevance

123

/tonic/tonic/src/
H A Dresponse.rs7 pub struct Response<T> {
9 message: T,
13 impl<T> Response<T> {
26 pub fn new(message: T) -> Self { in new()
35 pub fn get_ref(&self) -> &T { in get_ref() argument
40 pub fn get_mut(&mut self) -> &mut T { in get_mut() argument
55 pub fn into_inner(self) -> T { in into_inner() argument
82 pub(crate) fn into_http(self) -> http::Response<T> { in into_http() argument
95 F: FnOnce(T) -> U, in map()
130 impl<T> From<T> for Response<T> {
[all …]
H A Drequest.rs18 pub struct Request<T> {
20 message: T,
101 impl<T> Request<T> {
198 F: FnOnce(T) -> U, in map()
355 impl<T> IntoRequest<T> for T { implementation
361 impl<T> IntoRequest<T> for Request<T> {
367 impl<T> IntoStreamingRequest for T implementation
371 type Stream = T;
379 impl<T> IntoStreamingRequest for Request<T>
383 type Stream = T;
[all …]
H A Dcodegen.rs19 pub type BoxFuture<T, E> = self::Pin<Box<dyn self::Future<Output = Result<T, E>> + Send + 'static>>;
20 pub type BoxStream<T> =
21 self::Pin<Box<dyn tokio_stream::Stream<Item = Result<T, crate::Status>> + Send + 'static>>;
/tonic/tonic/benches-disabled/benchmarks/compiled_protos/
H A Dhelloworld.rs18 pub struct GreeterClient<T> {
32 impl<T> GreeterClient<T>
36 T::Error: Into<StdError>,
64 impl<T: Clone> Clone for GreeterClient<T> {
90 inner: Arc<T>,
95 inner: Arc<T>,
97 impl<T: Greeter> GreeterServer<T> {
107 impl<T: Greeter> GreeterServerSvc<T> {
112 impl<T: Greeter, R> Service<R> for GreeterServer<T> {
123 impl<T: Greeter> Service<http::Request<HyperBody>> for GreeterServerSvc<T> {
[all …]
/tonic/examples/src/codec_buffers/
H A Dcommon.rs18 pub struct SmallBufferCodec<T, U>(PhantomData<(T, U)>);
20 impl<T, U> Codec for SmallBufferCodec<T, U>
22 T: Message + Send + 'static,
25 type Encode = T;
28 type Encoder = <ProstCodec<T, U> as Codec>::Encoder;
29 type Decoder = <ProstCodec<T, U> as Codec>::Decoder;
35 ProstCodec::<T, U>::raw_encoder(BufferSettings::new(512, 4096)) in encoder()
39 ProstCodec::<T, U>::raw_decoder(BufferSettings::new(512, 4096)) in decoder()
/tonic/examples/src/json-codec/
H A Dcommon.rs24 pub struct JsonEncoder<T>(PhantomData<T>);
26 impl<T: serde::Serialize> Encoder for JsonEncoder<T> {
27 type Item = T;
55 pub struct JsonCodec<T, U>(PhantomData<(T, U)>);
57 impl<T, U> Default for JsonCodec<T, U> {
63 impl<T, U> Codec for JsonCodec<T, U>
65 T: serde::Serialize + Send + 'static,
68 type Encode = T;
70 type Encoder = JsonEncoder<T>;
/tonic/tonic/src/server/
H A Dservice.rs21 impl<T, M1, M2> UnaryService<M1> for T implementation
23 T: Service<Request<M1>, Response = Response<M2>, Error = crate::Status>,
26 type Future = T::Future;
51 impl<T, S, M1, M2> ServerStreamingService<M1> for T implementation
53 T: Service<Request<M1>, Response = Response<S>, Error = crate::Status>,
58 type Future = T::Future;
80 impl<T, M1, M2> ClientStreamingService<M1> for T implementation
85 type Future = T::Future;
110 impl<T, S, M1, M2> StreamingService<M1> for T implementation
112 T: Service<Request<Streaming<M1>>, Response = Response<S>, Error = crate::Status>,
[all …]
H A Dgrpc.rs34 pub struct Grpc<T> {
35 codec: T,
46 impl<T> Grpc<T>
48 T: Codec,
51 pub fn new(codec: T) -> Self { in new()
225 S: UnaryService<T::Decode, Response = T::Encode>, in unary()
268 S: ServerStreamingService<T::Decode, Response = T::Encode>, in server_streaming()
309 S: ClientStreamingService<T::Decode, Response = T::Encode>, in client_streaming()
342 S: StreamingService<T::Decode, Response = T::Encode> + Send, in streaming()
367 ) -> Result<Request<T::Decode>, Status> in map_request_unary()
[all …]
/tonic/tonic-health/src/generated/
H A Dgrpc_health_v1.rs73 impl<T> HealthClient<T>
89 inner: T, in with_interceptor() argument
255 inner: Arc<T>,
261 impl<T> HealthServer<T> {
275 inner: T, in with_interceptor() argument
312 impl<T, B> tonic::codegen::Service<http::Request<B>> for HealthServer<T>
314 T: Health,
331 struct CheckSvc<T: Health>(pub Arc<T>); in call()
376 struct WatchSvc<T: Health>(pub Arc<T>); in call()
442 impl<T> Clone for HealthServer<T> {
[all …]
/tonic/tonic/src/transport/channel/service/
H A Duser_agent.rs8 pub(crate) struct UserAgent<T> {
9 inner: T,
13 impl<T> UserAgent<T> {
14 pub(crate) fn new(inner: T, user_agent: Option<HeaderValue>) -> Self { in new() argument
29 impl<T, ReqBody> Service<Request<ReqBody>> for UserAgent<T>
31 T: Service<Request<ReqBody>>,
33 type Response = T::Response;
34 type Error = T::Error;
35 type Future = T::Future;
H A Dadd_origin.rs9 pub(crate) struct AddOrigin<T> {
10 inner: T,
15 impl<T> AddOrigin<T> {
16 pub(crate) fn new(inner: T, origin: Uri) -> Self { in new() argument
29 impl<T, ReqBody> Service<Request<ReqBody>> for AddOrigin<T>
31 T: Service<Request<ReqBody>>,
32 T::Future: Send + 'static,
33 T::Error: Into<crate::BoxError>,
35 type Response = T::Response;
/tonic/tonic/src/transport/server/
H A Dconn.rs106 impl<T> Connected for TlsStream<T>
108 T: Connected,
110 type ConnectInfo = TlsConnectInfo<T::ConnectInfo>;
133 pub struct TlsConnectInfo<T> {
134 inner: T,
139 impl<T> TlsConnectInfo<T> {
141 pub fn get_ref(&self) -> &T { in get_ref() argument
146 pub fn get_mut(&mut self) -> &mut T { in get_mut() argument
/tonic/tonic-reflection/src/generated/
H A Dgrpc_reflection_v1.rs162 impl<T> ServerReflectionClient<T>
165 T::Error: Into<StdError>,
178 inner: T, in with_interceptor() argument
296 inner: Arc<T>,
302 impl<T> ServerReflectionServer<T> {
316 inner: T, in with_interceptor() argument
353 impl<T, B> tonic::codegen::Service<http::Request<B>> for ServerReflectionServer<T>
355 T: ServerReflection,
372 struct ServerReflectionInfoSvc<T: ServerReflection>(pub Arc<T>); in call()
444 impl<T> Clone for ServerReflectionServer<T> {
[all …]
H A Dgrpc_reflection_v1alpha.rs162 impl<T> ServerReflectionClient<T>
165 T::Error: Into<StdError>,
178 inner: T, in with_interceptor() argument
296 inner: Arc<T>,
302 impl<T> ServerReflectionServer<T> {
316 inner: T, in with_interceptor() argument
353 impl<T, B> tonic::codegen::Service<http::Request<B>> for ServerReflectionServer<T>
355 T: ServerReflection,
372 struct ServerReflectionInfoSvc<T: ServerReflection>(pub Arc<T>); in call()
444 impl<T> Clone for ServerReflectionServer<T> {
[all …]
/tonic/tonic/src/client/
H A Dgrpc.rs32 pub struct Grpc<T> {
33 inner: T,
49 impl<T> Grpc<T> {
201 T: GrpcService<Body>, in ready()
214 T: GrpcService<Body>, in unary()
233 T: GrpcService<Body>, in client_streaming()
270 T: GrpcService<Body>, in server_streaming()
289 T: GrpcService<Body>, in streaming()
329 T: GrpcService<Body>, in create_response()
429 impl<T: Clone> Clone for Grpc<T> {
[all …]
H A Dservice.rs32 impl<T, ReqBody, ResBody> GrpcService<ReqBody> for T implementation
34 T: Service<http::Request<ReqBody>, Response = http::Response<ResBody>>,
35 T::Error: Into<crate::BoxError>,
40 type Error = T::Error;
41 type Future = T::Future;
/tonic/tonic-build/src/
H A Dclient.rs12 service: &T, in generate_internal() argument
68 impl<T> #service_ident<T> in generate_internal()
168 service: &T, in generate_methods() argument
222 service: &T, in generate_unary() argument
223 method: &T::Method, in generate_unary()
253 service: &T, in generate_server_streaming() argument
254 method: &T::Method, in generate_server_streaming()
284 service: &T, in generate_client_streaming() argument
285 method: &T::Method, in generate_client_streaming()
315 service: &T, in generate_streaming() argument
[all …]
H A Dserver.rs14 service: &T, in generate_internal() argument
122 impl<T> #server_service<T> { in generate_internal()
178 impl<T> Clone for #server_service<T> { in generate_internal()
198 service: &T, in generate_trait() argument
231 service: &T, in generate_trait_methods() argument
436 method: &T, in generate_unary() argument
457 struct #service_ident<T: #server_trait >(pub Arc<T>); in generate_unary()
494 method: &T, in generate_server_streaming() argument
561 method: &T, in generate_client_streaming() argument
619 method: &T, in generate_streaming() argument
[all …]
H A Dlib.rs201 fn format_service_name<T: Service>(service: &T, emit_package: bool) -> String { in format_service_name() argument
211 fn format_method_path<T: Service>(service: &T, method: &T::Method, emit_package: bool) -> String { in format_method_path() argument
219 fn format_method_name<T: Service>(service: &T, method: &T::Method, emit_package: bool) -> String { in format_method_name() argument
282 fn generate_doc_comments<T: AsRef<str>>(comments: &[T]) -> TokenStream { in generate_doc_comments()
/tonic/tonic/src/service/
H A Dlayered.rs13 pub struct Layered<S, T> {
15 _ty: PhantomData<T>,
18 impl<S, T: NamedService> NamedService for Layered<S, T> {
19 const NAME: &'static str = T::NAME;
22 impl<Req, S, T> Service<Req> for Layered<S, T>
61 impl<T> Sealed for T {} implementation
/tonic/tonic/src/codec/
H A Dencode.rs26 encoder: T,
34 impl<T: Encoder, U: Stream> EncodedBytes<T, U> {
36 encoder: T, in new() argument
70 impl<T, U> Stream for EncodedBytes<T, U>
133 fn encode_item<T>( in encode_item()
134 encoder: &mut T, in encode_item() argument
140 item: T::Item, in encode_item()
231 impl<T: Encoder, U: Stream> EncodeBody<T, U> {
235 encoder: T, in new_client() argument
259 encoder: T, in new_server() argument
[all …]
H A Dprost.rs9 pub struct ProstCodec<T, U> {
10 _pd: PhantomData<(T, U)>,
13 impl<T, U> ProstCodec<T, U> {
21 impl<T, U> Default for ProstCodec<T, U> {
27 impl<T, U> ProstCodec<T, U>
51 impl<T, U> Codec for ProstCodec<T, U>
56 type Encode = T;
80 _pd: PhantomData<T>,
84 impl<T> ProstEncoder<T> {
94 impl<T: Message> Encoder for ProstEncoder<T> {
[all …]
H A Ddecode.rs21 pub struct Streaming<T> {
37 impl<T> Unpin for Streaming<T> {}
56 impl<T> Streaming<T> {
69 D: Decoder<Item = T, Error = Status> + Send + 'static, in new_response()
85 D: Decoder<Item = T, Error = Status> + Send + 'static, in new_empty()
101 D: Decoder<Item = T, Error = Status> + Send + 'static, in new_request()
122 D: Decoder<Item = T, Error = Status> + Send + 'static, in new()
300 impl<T> Streaming<T> {
386 impl<T> Stream for Streaming<T> {
387 type Item = Result<T, Status>;
[all …]
/tonic/tonic/src/transport/server/service/
H A Dio.rs13 pub(crate) struct ConnectInfoLayer<T> {
14 connect_info: T,
17 impl<T> ConnectInfoLayer<T> {
18 pub(crate) fn new(connect_info: T) -> Self { in new()
23 impl<S, T> Layer<S> for ConnectInfoLayer<T>
25 T: Clone,
27 type Service = ConnectInfo<S, T>;
35 pub(crate) struct ConnectInfo<S, T> {
37 connect_info: T,
40 impl<S, T> ConnectInfo<S, T> {
[all …]
/tonic/tests/compression/src/
H A Dutil.rs86 struct ChannelBody<T> {
88 rx: tokio::sync::mpsc::Receiver<Frame<T>>,
91 impl<T> ChannelBody<T> {
92 pub fn new() -> (tokio::sync::mpsc::Sender<Frame<T>>, Self) { in new()
98 impl<T> HttpBody for ChannelBody<T>
100 T: Buf,
102 type Data = T;

123