pub struct MetadataMap {
pub inner: HashMap<String, MetadataValue>,
}Expand description
A generic metadata map. Newtype with a flattened map so that serde encodes just a JSON/YAML object and not an inner field name.
Fields§
§inner: HashMap<String, MetadataValue>Implementations§
Source§impl MetadataMap
impl MetadataMap
Sourcepub fn iter(&self) -> impl Iterator<Item = (&String, &MetadataValue)>
pub fn iter(&self) -> impl Iterator<Item = (&String, &MetadataValue)>
Iterate over key-value pairs.
Sourcepub fn insert<K: Into<String>, V: Into<MetadataValue>>(
&mut self,
key: K,
value: V,
)
pub fn insert<K: Into<String>, V: Into<MetadataValue>>( &mut self, key: K, value: V, )
Insert any value implementing Into
Sourcepub fn get(&self, key: &str) -> Option<&MetadataValue>
pub fn get(&self, key: &str) -> Option<&MetadataValue>
Get a value by key.
Sourcepub fn get_mut(&mut self, key: &str) -> Option<&mut MetadataValue>
pub fn get_mut(&mut self, key: &str) -> Option<&mut MetadataValue>
Mutable get.
Sourcepub fn extend(&mut self, other: MetadataMap)
pub fn extend(&mut self, other: MetadataMap)
Extend metadata map with another.
Trait Implementations§
Source§impl Clone for MetadataMap
impl Clone for MetadataMap
Source§fn clone(&self) -> MetadataMap
fn clone(&self) -> MetadataMap
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MetadataMap
impl Debug for MetadataMap
Source§impl Default for MetadataMap
impl Default for MetadataMap
Source§fn default() -> MetadataMap
fn default() -> MetadataMap
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for MetadataMap
impl<'de> Deserialize<'de> for MetadataMap
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<MetadataMap> for MetadataValue
impl From<MetadataMap> for MetadataValue
Source§fn from(m: MetadataMap) -> Self
fn from(m: MetadataMap) -> Self
Converts to this type from the input type.
Source§impl<K, V> FromIterator<(K, V)> for MetadataMap
impl<K, V> FromIterator<(K, V)> for MetadataMap
Source§impl JsonSchema for MetadataMap
impl JsonSchema for MetadataMap
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for MetadataMap
impl PartialEq for MetadataMap
Source§fn eq(&self, other: &MetadataMap) -> bool
fn eq(&self, other: &MetadataMap) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for MetadataMap
impl Serialize for MetadataMap
impl StructuralPartialEq for MetadataMap
Source§impl TryFrom<&MetadataValue> for MetadataMap
impl TryFrom<&MetadataValue> for MetadataMap
Source§type Error = MetadataConversionError
type Error = MetadataConversionError
The type returned in the event of a conversion error.
Source§impl TryFrom<MetadataValue> for MetadataMap
impl TryFrom<MetadataValue> for MetadataMap
Source§type Error = MetadataConversionError
type Error = MetadataConversionError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for MetadataMap
impl RefUnwindSafe for MetadataMap
impl Send for MetadataMap
impl Sync for MetadataMap
impl Unpin for MetadataMap
impl UnsafeUnpin for MetadataMap
impl UnwindSafe for MetadataMap
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request