MetadataExt

Trait MetadataExt 

Source
pub trait MetadataExt<T> {
    type Error;

    // Required methods
    fn extract(&self) -> Result<T, Self::Error>;
    fn inject(&mut self, value: T) -> Result<(), Self::Error>;
}
Expand description

Task metadata extension trait and implementations. This trait allows for injecting and extracting metadata associated with tasks.

Required Associated Types§

Source

type Error

The error type that can occur during extraction or injection.

Required Methods§

Source

fn extract(&self) -> Result<T, Self::Error>

Extract metadata of type T.

Source

fn inject(&mut self, value: T) -> Result<(), Self::Error>

Inject metadata of type T.

Implementations on Foreign Types§

Source§

impl<T> MetadataExt<T> for Map<String, Value>

Available on crate feature json only.
Source§

type Error = Error

Source§

fn extract(&self) -> Result<T, Error>

Source§

fn inject(&mut self, value: T) -> Result<(), Error>

Implementors§