Home
last modified time | relevance | path

Searched refs:len (Results 1 – 25 of 27) sorted by relevance

12

/tonic/tonic/src/codec/
H A Dbuffer.rs8 len: usize, field
19 DecodeBuf { buf, len } in new()
26 self.len in remaining()
33 if ret.len() > self.len { in chunk()
34 &ret[..self.len] in chunk()
42 assert!(cnt <= self.len); in advance()
44 self.len -= cnt; in advance()
49 assert!(len <= self.len); in copy_to_bytes()
50 self.len -= len; in copy_to_bytes()
51 self.buf.copy_to_bytes(len) in copy_to_bytes()
[all …]
H A Dencode.rs102 return Poll::Ready(Some(Ok(buf.split_to(buf.len()).freeze()))); in poll_next()
117 if buf.len() >= buffer_settings.yield_threshold { in poll_next()
118 return Poll::Ready(Some(Ok(buf.split_to(buf.len()).freeze()))); in poll_next()
126 return Poll::Ready(Some(Ok(buf.split_to(buf.len()).freeze()))); in poll_next()
145 let offset = buf.len(); in encode_item()
159 let uncompressed_len = uncompression_buf.len(); in encode_item()
186 let len = buf.len() - HEADER_SIZE; in finish_encoding() localVariable
188 if len > limit { in finish_encoding()
191 len, limit in finish_encoding()
195 if len > u32::MAX as usize { in finish_encoding()
[all …]
H A Dcompression.rs216 len: usize, in compress()
229 &decompressed_buf[0..len], in compress()
238 &decompressed_buf[0..len], in compress()
247 &decompressed_buf[0..len], in compress()
255 decompressed_buf.advance(len); in compress()
266 len: usize, in decompress()
269 let estimate_decompressed_len = len * 2; in decompress()
280 let mut gzip_decoder = GzDecoder::new(&compressed_buf[0..len]); in decompress()
285 let mut deflate_decoder = ZlibDecoder::new(&compressed_buf[0..len]); in decompress()
290 let mut zstd_decoder = Decoder::new(&compressed_buf[0..len])?; in decompress()
[all …]
H A Ddecode.rs44 len: usize,
185 let len = self.buf.get_u32() as usize; in decode_chunk() localVariable
189 if len > limit { in decode_chunk()
193 len, limit in decode_chunk()
198 self.buf.reserve(len); in decode_chunk()
202 len, in decode_chunk()
206 if let State::ReadBody { len, compression } = self.state { in decode_chunk()
209 if self.buf.remaining() < len || self.buf.len() < len { in decode_chunk()
223 len, in decode_chunk()
235 let decompressed_len = self.decompress_buf.len(); in decode_chunk()
[all …]
H A Dprost.rs174 buf.reserve(msg.len() + HEADER_SIZE); in decode()
176 buf.put_u32(msg.len() as u32); in decode()
186 assert_eq!(output_msg.len(), msg.len()); in decode()
200 buf.reserve(msg.len() + HEADER_SIZE); in decode_max_message_size_exceeded()
202 buf.put_u32(msg.len() as u32); in decode_max_message_size_exceeded()
214 msg.len(), in decode_max_message_size_exceeded()
389 let data_len = self.data.len(); in poll_frame()
/tonic/tonic/benches/
H A Ddecode.rs22 b.bytes = body.len() as u64;
31 assert_eq!($message_size, msg.len());
54 fn len(&self) -> usize { in len() method
55 self.data.len() in len()
80 SizeHint::with_exact(self.data.len() as u64) in size_hint()
87 write!(f, "{:?}...({})", sample, self.data.len()) in fmt()
118 buf.reserve(msg.len() + 5); in make_payload()
120 buf.put_u32(msg.len() as u32); in make_payload()
/tonic/interop/src/
H A Dclient.rs60 let payload_len = body.payload.as_ref().map(|p| p.body.len()).unwrap_or(0); in large_unary()
85 let requests = REQUEST_LENGTHS.iter().map(|len| StreamingInputCallRequest { in client_streaming()
86 payload: Some(crate::client_payload(*len as usize)), in client_streaming()
115 .map(|len| ResponseParameters::with_size(*len)) in server_streaming()
139 responses.len() == 4, in server_streaming()
140 format!("responses.len()={:?}", responses.len()) in server_streaming()
176 if responses.len() == REQUEST_LENGTHS.len() { in ping_pong()
180 tx.send(make_ping_pong_request(responses.len())).unwrap(); in ping_pong()
198 responses.len() == RESPONSE_LENGTHS.len(), in ping_pong()
199 format!("{:?}={:?}", responses.len(), RESPONSE_LENGTHS.len()) in ping_pong()
[all …]
H A Dlib.rs43 Some(ref payload) => payload.body.len() as i32, in response_length()
H A Dserver.rs94 aggregated_payload_size += msg.payload.unwrap().body.len() as i32; in streaming_input_call()
/tonic/tonic-web/src/
H A Dcall.rs141 (self.buf.len() / 4) * 4 in max_decodable()
315 FindTrailers::Done(len) => Poll::Ready(match len { in poll_frame()
448 let len = trailers.len(); in make_trailers_frame() localVariable
449 assert!(len <= u32::MAX as usize); in make_trailers_frame()
453 frame.put_u32(len as u32); in make_trailers_frame()
464 let mut len = 0; in find_trailers() localVariable
471 return Ok(FindTrailers::Done(len)); in find_trailers()
477 return Ok(FindTrailers::Trailer(len)); in find_trailers()
489 len += msg_len as usize + 4 + 1; in find_trailers()
493 if len > buf.len() { in find_trailers()
[all …]
/tonic/tonic/benches-disabled/benchmarks/
H A Drequest_response.rs38 group.throughput(Throughput::Bytes(size.len() as u64)); in bench_throughput()
40 group.bench_with_input(BenchmarkId::new("request", size.len()), size, |b, i| { in bench_throughput()
43 group.bench_with_input(BenchmarkId::new("response", size.len()), size, |b, i| { in bench_throughput()
H A Drequest_response_diverse_types.rs88 group.throughput(Throughput::Bytes(size.len() as u64)); in bench_throughput()
90 group.bench_with_input(BenchmarkId::new("request", size.len()), size, |b, i| { in bench_throughput()
/tonic/tests/web/tests/
H A Dgrpc_web.rs101 let len = buf.len() - 5; in encode_body() localVariable
105 buf.put_u32(len as u32); in encode_body()
108 buf.split_to(len + 5).freeze() in encode_body()
149 let len = body.get_u32(); in decode_body() localVariable
150 let msg = Output::decode(&mut body.split_to(len as usize)).expect("decode"); in decode_body()
/tonic/tonic-build/src/
H A Dlib.rs304 if pattern_segments.len() > path_segments.len() { in match_name()
307 pattern_segments[..] == path_segments[..pattern_segments.len()] in match_name()
310 } else if pattern_segments.len() > path_segments.len() { in match_name()
313 pattern_segments[..] == path_segments[path_segments.len() - pattern_segments.len()..] in match_name()
/tonic/examples/src/richer-error/
H A Dserver.rs31 } else if name.len() > 20 { in say_hello()
H A Dserver_vec.rs31 } else if name.len() > 20 { in say_hello()
/tonic/examples/src/tls_client_auth/
H A Dserver.rs21 println!("Got {} peer certs!", certs.len()); in unary_echo()
/tonic/tonic/src/transport/service/
H A Dgrpc_timeout.rs119 .split_at(val.len() - 1); in try_parse_grpc_timeout()
123 if timeout_value.len() > 8 { in try_parse_grpc_timeout()
/tonic/examples/src/routeguide/
H A Dclient.rs50 println!("Traversing {} points", points.len()); in run_record_route()
/tonic/tests/compression/src/
H A Dlib.rs58 assert_eq!(req.into_inner().data.len(), UNCOMPRESSED_MIN_BODY_SIZE); in compress_input_unary()
H A Dutil.rs79 data.len() in frame_data_length()
/tonic/interop/src/bin/
H A Dclient.rs99 println!("{} tests failed", failures.len()); in main()
/tonic/tonic/src/metadata/
H A Dvalue.rs415 pub fn len(&self) -> usize { in len() method
416 self.inner.len() in len()
/tonic/tonic/src/
H A Dstatus.rs511 let mut header_map = HeaderMap::with_capacity(3 + self.metadata.len()); in to_header_map()
790 match bytes.len() { in from_bytes()
/tonic/tonic-types/src/richer_error/
H A Dmod.rs807 let mut details: Vec<ErrorDetail> = Vec::with_capacity(self.details.len()); in check_error_details_vec()

12