diff --git a/tonic/src/metadata/map.rs b/tonic/src/metadata/map.rs index bf9489651..dc6d4d39e 100644 --- a/tonic/src/metadata/map.rs +++ b/tonic/src/metadata/map.rs @@ -38,6 +38,18 @@ pub struct MetadataMap { headers: http::HeaderMap, } +impl AsRef for MetadataMap { + fn as_ref(&self) -> &http::HeaderMap { + &self.headers + } +} + +impl AsMut for MetadataMap { + fn as_mut(&mut self) -> &mut http::HeaderMap { + &mut self.headers + } +} + /// `MetadataMap` entry iterator. /// /// Yields `KeyAndValueRef` values. The same header name may be yielded