Home
last modified time | relevance | path

Searched refs:body (Results 1 – 25 of 53) sorted by relevance

123

/tonic/tonic/src/
H A Dbody.rs33 pub fn new<B>(body: B) -> Self in new()
38 if body.is_end_stream() { in new()
42 let mut body = Some(body); in new() localVariable
44 if let Some(body) = <dyn std::any::Any>::downcast_mut::<Option<Body>>(&mut body) { in new()
45 return body.take().unwrap(); in new()
48 if let Some(body) = <dyn std::any::Any>::downcast_mut::<Option<BoxBody>>(&mut body) { in new()
52 let body = body in new() localVariable
57 Self::from_kind(Kind::Wrap(body)) in new()
77 Kind::Wrap(body) => Pin::new(body).poll_frame(cx), in poll_frame()
84 Kind::Wrap(body) => body.size_hint(), in size_hint()
[all …]
/tonic/tests/web/tests/
H A Dgrpc_web.rs6 use hyper::body::Incoming;
14 use tonic::body::Body;
132 .body(Body::new( in build_request()
138 async fn decode_body(body: Incoming, content_type: &str) -> (Output, Bytes) { in decode_body()
139 let mut body = body.collect().await.unwrap().to_bytes(); in decode_body() localVariable
142 body = test_web::util::base64::STANDARD in decode_body()
143 .decode(body) in decode_body()
148 body.advance(1); in decode_body()
149 let len = body.get_u32(); in decode_body()
151 body.advance(5); in decode_body()
[all …]
/tonic/tests/compression/
H A DCargo.toml10 http-body = "1"
11 http-body-util = "0.1"
21 tower-http = {version = "0.6", features = ["map-response-body", "map-request-body"]}
/tonic/tonic/src/codec/
H A Dprost.rs180 let body = body::MockBody::new(&buf[..], 10005, 0); in decode() localVariable
206 let body = body::MockBody::new(&buf[..], MAX_MESSAGE_SIZE + HEADER_SIZE + 1, 0); in decode_max_message_size_exceeded() localVariable
231 let mut body = pin!(EncodeBody::new_server( in encode() localVariable
239 while let Some(r) = body.frame().await { in encode()
253 let mut body = pin!(EncodeBody::new_server( in encode_max_message_size_exceeded() localVariable
261 let frame = body in encode_max_message_size_exceeded()
274 assert!(body.is_end_stream()); in encode_max_message_size_exceeded()
290 let mut body = pin!(EncodeBody::new_server( in encode_too_big() localVariable
298 let frame = body in encode_too_big()
311 assert!(body.is_end_stream()); in encode_too_big()
[all …]
H A Ddecode.rs3 use crate::{body::Body, metadata::MetadataMap, Code, Status};
27 body: Body, field
61 body: B, in new_response()
73 body, in new_response()
81 pub fn new_empty<B, D>(decoder: D, body: B) -> Self in new_empty()
87 Self::new(decoder, body, Direction::EmptyResponse, None, None) in new_empty()
94 body: B, in new_request()
105 body, in new_request()
114 body: B, in new()
128 body: Body::new( in new()
[all …]
/tonic/tonic/src/service/
H A Dinterceptor.rs235 fn wrap(body: B) -> Self { in wrap()
236 Self::new(ResponseBodyKind::Wrap(body)) in wrap()
250 ResponseBodyKindProj::Wrap(body) => body.poll_frame(cx), in poll_frame()
257 ResponseBodyKind::Wrap(body) => body.size_hint(), in size_hint()
264 ResponseBodyKind::Wrap(body) => body.is_end_stream(), in is_end_stream()
302 .body(()) in doesnt_remove_headers_from_requests()
321 let request = http::Request::builder().body(()).unwrap(); in handles_intercepted_status_as_response()
341 .body(()) in doesnt_change_http_method()
H A Drouter.rs1 use crate::{body::Body, server::NamedService, Status};
91 svc.map_request(|req: Request<axum::body::Body>| req.map(Body::new)), in add_service()
158 RoutesFuture(self.router.call(req.map(axum::body::Body::new))) in call()
H A Dmod.rs15 pub use axum::{body::Body as AxumBody, Router as AxumRouter};
/tonic/tests/compression/src/
H A Dserver_stream.rs26 .layer(MapResponseBodyLayer::new(move |body| { in client_enabled_server_enabled()
28 inner: body, in client_enabled_server_enabled()
91 .layer(MapResponseBodyLayer::new(move |body| { in client_disabled_server_enabled()
93 inner: body, in client_disabled_server_enabled()
143 .layer(MapResponseBodyLayer::new(move |body| { in client_enabled_server_disabled()
145 inner: body, in client_enabled_server_disabled()
H A Dcompressing_response.rs69 .layer(MapResponseBodyLayer::new(move |body| { in client_enabled_server_enabled()
71 inner: body, in client_enabled_server_enabled()
124 .layer(MapResponseBodyLayer::new(move |body| { in client_enabled_server_disabled()
126 inner: body, in client_enabled_server_disabled()
165 .layer(MapResponseBodyLayer::new(move |body| { in client_enabled_server_disabled_multi_encoding()
167 inner: body, in client_enabled_server_disabled_multi_encoding()
239 .layer(MapResponseBodyLayer::new(move |body| { in client_disabled()
241 inner: body, in client_disabled()
334 inner: body, in disabling_compression_on_single_response()
392 inner: body, in disabling_compression_on_response_but_keeping_compression_on_stream()
[all …]
H A Dutil.rs16 use tonic::body::Body;
118 MapRequestBodyLayer::new(move |mut body: Body| { in measure_request_body_size_layer()
123 while let Some(chunk) = body.frame().await { in measure_request_body_size_layer()
H A Dbidirectional_stream.rs60 .layer(MapResponseBodyLayer::new(move |body| { in client_enabled_server_enabled()
62 inner: body, in client_enabled_server_enabled()
/tonic/examples/proto/googleapis/google/api/
H A Dhttp.proto124 // For HTTP methods that allow a request body, the `body` field
132 // body: "message"
138 // Message message = 2; // mapped to the body
159 // body: "*"
213 // - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the H…
214 // request body.
219 // 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fi…
221 // 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all
348 // pattern to the HTTP body, or omitted for not having any HTTP request body.
352 string body = 7; field
[all …]
/tonic/tests/web/
H A DCargo.toml10 http-body = "1"
11 http-body-util = "0.1"
/tonic/tonic/src/client/
H A Dgrpc.rs5 body::Body,
241 let (mut parts, body, extensions) = in client_streaming()
244 let mut body = pin!(body); in client_streaming() localVariable
246 let message = body in client_streaming()
255 if let Some(trailers) = body.trailers().await? { in client_streaming()
353 let response = response.map(|body| { in create_response()
357 body, in create_response()
363 Streaming::new_empty(decoder, body) in create_response()
/tonic/tonic/src/server/
H A Dgrpc.rs7 body::Body,
374 let (parts, body) = request.into_parts(); in map_request_unary()
378 body, in map_request_unary()
407 let request = request.map(|body| { in map_request_streaming()
410 body, in map_request_streaming()
431 let (mut parts, body) = response.into_http().into_parts(); in map_response()
447 let body = EncodeBody::new_server( in map_response() localVariable
449 body, in map_response()
455 http::Response::from_parts(parts, Body::new(body)) in map_response()
/tonic/interop/src/
H A Dclient.rs31 let body = response.into_inner(); in empty_unary() localVariable
34 body == Empty {}, in empty_unary()
35 format!("body={:?}", body) in empty_unary()
59 let body = response.into_inner(); in large_unary() localVariable
60 let payload_len = body.payload.as_ref().map(|p| p.body.len()).unwrap_or(0); in large_unary()
65 format!("mem::size_of_val(&body)={:?}", mem::size_of_val(&body)) in large_unary()
101 let body = response.into_inner(); in client_streaming() localVariable
105 body.aggregated_payload_size == 74922, in client_streaming()
106 format!("aggregated_payload_size={:?}", body.aggregated_payload_size) in client_streaming()
H A Dlib.rs21 body: iter::repeat_n(0u8, size).collect(), in client_payload()
28 body: iter::repeat_n(0u8, size).collect(), in server_payload()
43 Some(ref payload) => payload.body.len() as i32, in response_length()
/tonic/interop/
H A DCargo.toml21 http-body = "1"
22 http-body-util = "0.1"
/tonic/examples/src/h2c/
H A Dclient.rs37 use hyper::body::Incoming;
42 use tonic::body::Body;
68 .body(Body::default()) in call()
/tonic/tests/integration_tests/tests/
H A Dorigin.rs84 impl<T> Service<Request<tonic::body::Body>> for OriginService<T>
86 T: Service<Request<tonic::body::Body>>,
98 fn call(&mut self, req: Request<tonic::body::Body>) -> Self::Future { in call()
/tonic/tonic/src/transport/channel/service/
H A Dadd_origin.rs50 let (mut head, body) = req.into_parts(); in call()
63 let request = Request::from_parts(head, body); in call()
/tonic/tonic/benches/
H A Ddecode.rs21 let body = MockBody::new(payload, $chunk_size); localVariable
22 b.bytes = body.len() as u64;
27 let mut stream = Streaming::new_request(decoder, body.clone(), None, None);
/tonic/tonic-web/src/
H A Dservice.rs9 use tonic::{body::Body, server::NamedService};
148 .body(()) in immediate()
296 .body(Body::default()) in request()
378 .body(Body::default()) in request()
398 .body(Body::default()) in request()
418 .body(Body::default()) in h1_is_err()
449 .body(Body::default()) in request()
/tonic/tonic-health/src/generated/
H A Dgrpc_health_v1.rs75 T: tonic::client::GrpcService<tonic::body::Body>,
96 http::Request<tonic::body::Body>, in with_interceptor()
98 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody, in with_interceptor()
102 http::Request<tonic::body::Body>, in with_interceptor()
318 type Response = http::Response<tonic::body::Body>;
423 tonic::body::Body::default(), in call()

123