pub trait MetadataExt {
// Required method
fn get_value(&self, key: &str) -> Option<&Value>;
// Provided methods
fn get_typed<'a, T: Deserialize<'a>>(
&'a self,
key: MetadataKey<T>,
) -> Result<Option<T>> { ... }
fn require_typed<'a, T: Deserialize<'a>>(
&'a self,
key: MetadataKey<T>,
) -> Result<T> { ... }
}
Expand description
Helper functions for reading LockedApp metadata
Required Methods§
Provided Methods§
Sourcefn get_typed<'a, T: Deserialize<'a>>(
&'a self,
key: MetadataKey<T>,
) -> Result<Option<T>>
fn get_typed<'a, T: Deserialize<'a>>( &'a self, key: MetadataKey<T>, ) -> Result<Option<T>>
Get a typed value from a metadata map
Sourcefn require_typed<'a, T: Deserialize<'a>>(
&'a self,
key: MetadataKey<T>,
) -> Result<T>
fn require_typed<'a, T: Deserialize<'a>>( &'a self, key: MetadataKey<T>, ) -> Result<T>
Get a required value from a metadata map, returning an error if it is not present
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.