Home
last modified time | relevance | path

Searched refs:from_bytes (Results 1 – 9 of 9) sorted by relevance

/tonic/tonic/src/metadata/
H A Dkey.rs41 pub fn from_bytes(src: &[u8]) -> Result<Self, InvalidMetadataKey> { in from_bytes() method
42 match HeaderName::from_bytes(src) { in from_bytes()
146 MetadataKey::from_bytes(s.as_bytes()).map_err(|_| InvalidMetadataKey::new()) in from_str()
286 assert!(BinaryMetadataKey::from_bytes(b"").is_err()); in test_from_bytes_binary()
287 assert!(BinaryMetadataKey::from_bytes(b"\xFF").is_err()); in test_from_bytes_binary()
288 assert!(BinaryMetadataKey::from_bytes(b"abc").is_err()); in test_from_bytes_binary()
290 BinaryMetadataKey::from_bytes(b"abc-bin").unwrap().as_str(), in test_from_bytes_binary()
297 assert!(AsciiMetadataKey::from_bytes(b"").is_err()); in test_from_bytes_ascii()
298 assert!(AsciiMetadataKey::from_bytes(b"\xFF").is_err()); in test_from_bytes_ascii()
300 AsciiMetadataKey::from_bytes(b"abc").unwrap().as_str(), in test_from_bytes_ascii()
[all …]
H A Dvalue.rs463 pub fn from_bytes(src: &[u8]) -> Self { in from_bytes() method
839 assert_eq!(Bmv::from_bytes(b"abc"), Bmv::from_bytes(b"abc")); in test_value_eq_value()
840 assert_ne!(Bmv::from_bytes(b"abc"), Bmv::from_bytes(b"ABC")); in test_value_eq_value()
866 assert_eq!(Bmv::from_bytes(b"abc"), "abc"); in test_value_eq_str()
867 assert_ne!(Bmv::from_bytes(b"abc"), "ABC"); in test_value_eq_str()
868 assert_eq!("abc", Bmv::from_bytes(b"abc")); in test_value_eq_str()
928 let value1 = Bmv::from_bytes(b"abc"); in test_valid_binary_value_hash()
929 let value2 = Bmv::from_bytes(b"abc"); in test_valid_binary_value_hash()
933 let value1 = Bmv::from_bytes(b"abc"); in test_valid_binary_value_hash()
934 let value2 = Bmv::from_bytes(b"xyz"); in test_valid_binary_value_hash()
[all …]
H A Dencoding.rs26 fn from_bytes(value: &[u8]) -> Result<HeaderValue, InvalidMetadataValueBytes>; in from_bytes() method
85 fn from_bytes(value: &[u8]) -> Result<HeaderValue, InvalidMetadataValueBytes> { in from_bytes() method
86 HeaderValue::from_bytes(value).map_err(|_| InvalidMetadataValueBytes::new()) in from_bytes()
130 fn from_bytes(value: &[u8]) -> Result<HeaderValue, InvalidMetadataValueBytes> { in from_bytes() method
137 Self::from_bytes(value.as_ref()) in from_shared()
H A Dmap.rs2280 let key = http::header::HeaderName::from_bytes(self.as_bytes()) in entry()
2342 let key = http::header::HeaderName::from_bytes(self.as_bytes()) in entry()
2403 let key = http::header::HeaderName::from_bytes(self.as_bytes()) in entry()
2542 map.append_bin("x-word-bin", MetadataValue::from_bytes(b"goodbye")); in test_iter_categorizes_ascii_entries()
2543 map.insert_bin("x-number-bin", MetadataValue::from_bytes(b"123")); in test_iter_categorizes_ascii_entries()
2563 map.append_bin("x-word-bin", MetadataValue::from_bytes(b"goodbye")); in test_iter_categorizes_binary_entries()
2584 map.insert_bin("x-number-bin", MetadataValue::from_bytes(b"123")); in test_iter_mut_categorizes_ascii_entries()
2625 map.insert_bin("x-number-bin", MetadataValue::from_bytes(b"123")); in test_keys_categorizes_ascii_entries()
2645 map.insert_bin("x-number-bin", MetadataValue::from_bytes(b"123")); in test_keys_categorizes_binary_entries()
2666 map.insert_bin("x-number-bin", MetadataValue::from_bytes(b"123")); in test_values_categorizes_ascii_entries()
[all …]
/tonic/tonic/src/transport/channel/service/
H A Duser_agent.rs21 HeaderValue::from_bytes(&buf).expect("user-agent should be valid") in new()
/tonic/tests/integration_tests/tests/
H A Dstatus.rs85 metadata.insert_bin(BINARY_NAME, MetadataValue::from_bytes(BINARY_VALUE)); in status_with_metadata()
/tonic/interop/src/
H A Dclient.rs347 let value2 = MetadataValue::from_bytes(&[0xab, 0xab, 0xab]); in custom_metadata()
/tonic/tonic/src/
H A Dstatus.rs442 let code = Code::from_bytes(header_map.get(Self::GRPC_STATUS)?.as_ref()); in from_header_map()
789 pub fn from_bytes(bytes: &[u8]) -> Code { in from_bytes() method
/tonic/
H A DCHANGELOG.md150 * MetadataKey::from_bytes returns an error ([#1246](https://github.com/hyperium/tonic/issues/1246))…