| /tonic/tonic/src/codec/ |
| H A D | buffer.rs | 1 use bytes::buf::UninitSlice; 7 buf: &'a mut BytesMut, field 14 buf: &'a mut BytesMut, field 19 DecodeBuf { buf, len } in new() 43 self.buf.advance(cnt); in advance() 57 EncodeBuf { buf } in new() 86 self.buf.chunk_mut() in chunk_mut() 94 self.buf.put(src) in put() 99 self.buf.put_slice(src) in put_slice() 122 buf.advance(10); in decode_buf() [all …]
|
| H A D | encode.rs | 29 buf: BytesMut, field 63 buf, in new() 83 buf, in poll_next() 102 return Poll::Ready(Some(Ok(buf.split_to(buf.len()).freeze()))); in poll_next() 107 buf, in poll_next() 126 return Poll::Ready(Some(Ok(buf.split_to(buf.len()).freeze()))); in poll_next() 135 buf: &mut BytesMut, in encode_item() 145 let offset = buf.len(); in encode_item() 167 buf, in encode_item() 184 buf: &mut [u8], in finish_encoding() [all …]
|
| H A D | prost.rs | 99 item.encode(buf) in encode() 172 let mut buf = BytesMut::new(); in decode() localVariable 175 buf.put_u8(0); in decode() 176 buf.put_u32(msg.len() as u32); in decode() 178 buf.put(&msg[..]); in decode() 198 let mut buf = BytesMut::new(); in decode_max_message_size_exceeded() localVariable 201 buf.put_u8(0); in decode_max_message_size_exceeded() 202 buf.put_u32(msg.len() as u32); in decode_max_message_size_exceeded() 204 buf.put(&msg[..]); in decode_max_message_size_exceeded() 322 buf.put(&item[..]); in encode() [all …]
|
| H A D | decode.rs | 30 buf: BytesMut, field 130 frame.map_data(|mut buf| buf.copy_to_bytes(buf.remaining())) in new() 136 buf: BytesMut::with_capacity(buffer_size), in new() 152 if self.buf.remaining() < HEADER_SIZE { in decode_chunk() 156 let compression_encoding = match self.buf.get_u8() { in decode_chunk() 185 let len = self.buf.get_u32() as usize; in decode_chunk() 198 self.buf.reserve(len); in decode_chunk() 209 if self.buf.remaining() < len || self.buf.len() < len { in decode_chunk() 221 &mut self.buf, in decode_chunk() 238 DecodeBuf::new(&mut self.buf, len) in decode_chunk() [all …]
|
| /tonic/tonic-web/src/ |
| H A D | call.rs | 65 buf: BytesMut, field 141 (self.buf.len() / 4) * 4 in max_decodable() 146 if self.buf.is_empty() || self.buf.len() < 4 { in decode_chunk() 184 .buf in poll_decode() 395 buf.get_u8(); in decode_trailers_frame() 396 buf.get_u32(); in decode_trailers_frame() 465 let mut temp_buf = buf; in find_trailers() 493 if len > buf.len() { in find_trailers() 555 let buf = [ in find_trailers_non_buffered() localVariable 568 let buf = [ in find_trailers_buffered() localVariable [all …]
|
| /tonic/tests/integration_tests/tests/ |
| H A D | routes_builder.rs | 34 buf: request.into_inner().buf, in multiple_service_using_routes_builder() 45 buf: request.into_inner().buf, in multiple_service_using_routes_builder() 87 buf: b"hello".to_vec(), in multiple_service_using_routes_builder() 92 assert_eq!(&resp2.buf, b"hello"); in multiple_service_using_routes_builder() 95 buf: b"world".to_vec(), in multiple_service_using_routes_builder() 105 assert_eq!(&first.buf, b"world"); in multiple_service_using_routes_builder()
|
| H A D | max_message_size.rs | 139 buf: vec![0; 6877902], in response_stream_limit() 181 buf: client_blob.clone(), in response_stream_limit() 286 buf: self.0.clone(), in max_message_run() 357 buf: client_blob.clone(), in max_message_run()
|
| /tonic/tonic/benches/ |
| H A D | decode.rs | 106 fn decode(&mut self, buf: &mut DecodeBuf<'_>) -> Result<Option<Self::Item>, Self::Error> { in decode() 107 let out = Vec::from(buf.chunk()); in decode() 108 buf.advance(self.message_size); in decode() 114 let mut buf = BytesMut::new(); in make_payload() localVariable 118 buf.reserve(msg.len() + 5); in make_payload() 119 buf.put_u8(0); in make_payload() 120 buf.put_u32(msg.len() as u32); in make_payload() 121 buf.put(&msg[..]); in make_payload() 124 buf.freeze() in make_payload()
|
| /tonic/tests/web/tests/ |
| H A D | grpc_web.rs | 93 let mut buf = BytesMut::with_capacity(1024); in encode_body() localVariable 94 buf.reserve(5); in encode_body() 96 buf.advance_mut(5); in encode_body() 99 input.encode(&mut buf).unwrap(); in encode_body() 101 let len = buf.len() - 5; in encode_body() 103 let mut buf = &mut buf[..5]; in encode_body() localVariable 104 buf.put_u8(0); in encode_body() 105 buf.put_u32(len as u32); in encode_body() 108 buf.split_to(len + 5).freeze() in encode_body()
|
| /tonic/tonic/src/transport/channel/service/ |
| H A D | user_agent.rs | 17 let mut buf = Vec::new(); in new() localVariable 18 buf.extend(value.as_bytes()); in new() 19 buf.push(b' '); in new() 20 buf.extend(TONIC_USER_AGENT.as_bytes()); in new() 21 HeaderValue::from_bytes(&buf).expect("user-agent should be valid") in new()
|
| H A D | io.rs | 33 buf: rt::ReadBufCursor<'_>, in poll_read() 35 Pin::new(&mut self.0).poll_read(cx, buf) in poll_read() 43 buf: &[u8], in poll_write() 45 Pin::new(&mut self.0).poll_write(cx, buf) in poll_write()
|
| /tonic/examples/src/json-codec/ |
| H A D | common.rs | 30 fn encode(&mut self, item: Self::Item, buf: &mut EncodeBuf<'_>) -> Result<(), Self::Error> { in encode() 31 serde_json::to_writer(buf.writer(), &item).map_err(|e| Status::internal(e.to_string())) in encode() 42 fn decode(&mut self, buf: &mut DecodeBuf<'_>) -> Result<Option<Self::Item>, Self::Error> { in decode() 43 if !buf.has_remaining() { in decode() 48 serde_json::from_reader(buf.reader()).map_err(|e| Status::internal(e.to_string()))?; in decode()
|
| /tonic/tests/integration_tests/src/ |
| H A D | lib.rs | 30 buf: &mut ReadBuf<'_>, in poll_read() 32 Pin::new(&mut self.0).poll_read(cx, buf) in poll_read() 40 buf: &[u8], in poll_write() 42 Pin::new(&mut self.0).poll_write(cx, buf) in poll_write()
|
| /tonic/tests/integration_tests/proto/ |
| H A D | test.proto | 19 bytes buf = 1; field 22 bytes buf = 1; field
|
| /tonic/tonic/src/transport/server/service/ |
| H A D | io.rs | 128 buf: &mut ReadBuf<'_>, in poll_read() 131 Self::Io(io) => Pin::new(io).poll_read(cx, buf), in poll_read() 133 Self::TlsIo(io) => Pin::new(io).poll_read(cx, buf), in poll_read() 145 buf: &[u8], in poll_write() 148 Self::Io(io) => Pin::new(io).poll_write(cx, buf), in poll_write() 150 Self::TlsIo(io) => Pin::new(io).poll_write(cx, buf), in poll_write()
|
| /tonic/examples/src/tls_rustls/ |
| H A D | server.rs | 29 let mut buf = std::io::BufReader::new(&fd); in main() localVariable 30 CertificateDer::pem_reader_iter(&mut buf).collect::<Result<Vec<_>, _>>()? in main() 34 let mut buf = std::io::BufReader::new(&fd); in main() localVariable 35 PrivateKeyDer::from_pem_reader(&mut buf)? in main()
|
| H A D | client.rs | 23 let mut buf = std::io::BufReader::new(&fd); in main() localVariable 24 let certs = CertificateDer::pem_reader_iter(&mut buf).collect::<Result<Vec<_>, _>>()?; in main()
|
| /tonic/tonic-types/src/richer_error/std_messages/ |
| H A D | request_info.rs | 63 let buf: &[u8] = &any.value; in from_any_ref() localVariable 64 let req_info = pb::RequestInfo::decode(buf)?; in from_any_ref()
|
| H A D | loc_message.rs | 64 let buf: &[u8] = &any.value; in from_any_ref() localVariable 65 let loc_message = pb::LocalizedMessage::decode(buf)?; in from_any_ref()
|
| H A D | debug_info.rs | 60 let buf: &[u8] = &any.value; in from_any_ref() localVariable 61 let debug_info = pb::DebugInfo::decode(buf)?; in from_any_ref()
|
| H A D | resource_info.rs | 76 let buf: &[u8] = &any.value; in from_any_ref() localVariable 77 let res_info = pb::ResourceInfo::decode(buf)?; in from_any_ref()
|
| H A D | error_info.rs | 76 let buf: &[u8] = &any.value; in from_any_ref() localVariable 77 let error_info = pb::ErrorInfo::decode(buf)?; in from_any_ref()
|
| H A D | retry_info.rs | 75 let buf: &[u8] = &any.value; in from_any_ref() localVariable 76 let retry_info = pb::RetryInfo::decode(buf)?; in from_any_ref()
|
| H A D | help.rs | 118 let buf: &[u8] = &any.value; in from_any_ref() localVariable 119 let help = pb::Help::decode(buf)?; in from_any_ref()
|
| H A D | bad_request.rs | 122 let buf: &[u8] = &any.value; in from_any_ref() localVariable 123 let bad_req = pb::BadRequest::decode(buf)?; in from_any_ref()
|