pub struct Metadata(/* private fields */);Expand description
A type-erased container for metadata that can be associated with computation results.
Metadata allows attaching arbitrary typed information to computation results
and passing it through the computation pipeline.
Implementations§
Source§impl Metadata
impl Metadata
Sourcepub fn get<T: 'static + Clone>(&self) -> T
pub fn get<T: 'static + Clone>(&self) -> T
Gets a value of type T from the metadata.
§Panics
Panics if no value of type T is present in the metadata.
Sourcepub fn try_get<T: 'static + Clone>(&self) -> Option<T>
pub fn try_get<T: 'static + Clone>(&self) -> Option<T>
Attempts to get a value of type T from the metadata.
Returns None if no value of the requested type is present.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Metadata
impl !RefUnwindSafe for Metadata
impl !Send for Metadata
impl !Sync for Metadata
impl Unpin 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