Struct Metadata
pub struct Metadata { /* private fields */ }Expand description
Typed metadata map validated against a MetadataSchema.
Implementations§
§impl Metadata
impl Metadata
pub fn new(schema: &MetadataSchema) -> Metadata
pub fn new(schema: &MetadataSchema) -> Metadata
Creates metadata map with every core key pre-populated as None.
pub fn get(&self, key: &str) -> Option<&MetadataValue>
pub fn get(&self, key: &str) -> Option<&MetadataValue>
Returns metadata value by key.
pub fn clear(
&mut self,
schema: &MetadataSchema,
key: &str,
) -> Result<(), PixelFlowError>
pub fn clear( &mut self, schema: &MetadataSchema, key: &str, ) -> Result<(), PixelFlowError>
Clears registered metadata key by writing None.
pub fn iter(&self) -> impl Iterator<Item = (&str, &MetadataValue)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &MetadataValue)>
Iterates metadata entries in deterministic key order.
pub fn set(
&mut self,
schema: &MetadataSchema,
key: &str,
value: MetadataValue,
) -> Result<(), PixelFlowError>
pub fn set( &mut self, schema: &MetadataSchema, key: &str, value: MetadataValue, ) -> Result<(), PixelFlowError>
Writes metadata value after registration and type validation.
Trait Implementations§
impl StructuralPartialEq for Metadata
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnsafeUnpin for Metadata
impl UnwindSafe for Metadata
Blanket Implementations§
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