diff --git a/tonic/src/metadata/encoding.rs b/tonic/src/metadata/encoding.rs index 106be4eab..373a4a510 100644 --- a/tonic/src/metadata/encoding.rs +++ b/tonic/src/metadata/encoding.rs @@ -51,11 +51,25 @@ pub trait ValueEncoding: Clone + Eq + PartialEq + Hash + self::value_encoding::S fn is_valid_key(key: &str) -> bool; } +/// gRPC metadata values can be either ASCII strings or binary. Note that only +/// visible ASCII characters (32-127) are permitted. +/// This type should never be instantiated -- in fact, it's impossible +/// to, because there's no variants to instantiate. Instead, it's just used as +/// a type parameter for [`MetadataKey`] and [`MetadataValue`]. +/// +/// [`MetadataKey`]: struct.MetadataKey.html +/// [`MetadataValue`]: struct.MetadataValue.html #[derive(Clone, Debug, Eq, PartialEq, Hash)] -#[doc(hidden)] pub enum Ascii {} + +/// gRPC metadata values can be either ASCII strings or binary. +/// This type should never be instantiated -- in fact, it's impossible +/// to, because there's no variants to instantiate. Instead, it's just used as +/// a type parameter for [`MetadataKey`] and [`MetadataValue`]. +/// +/// [`MetadataKey`]: struct.MetadataKey.html +/// [`MetadataValue`]: struct.MetadataValue.html #[derive(Clone, Debug, Eq, PartialEq, Hash)] -#[doc(hidden)] pub enum Binary {} // ===== impl ValueEncoding =====