Trait forest_filecoin::shim::fvm_latest::kernel::Context

source ·
pub trait Context {
    type WithContext;

    // Required methods
    fn context<D>(self, context: D) -> Self::WithContext
       where D: Display;
    fn with_context<D, F>(self, cfn: F) -> Self::WithContext
       where D: Display,
             F: FnOnce() -> D;
}
Expand description

The FVM’s equivalent of anyhow::Context. This is intentionally only implemented on ExecutionError and Result<T, ExecutionError> so anyhow::Context can be imported at the same time.

Required Associated Types§

Required Methods§

source

fn context<D>(self, context: D) -> Self::WithContext
where D: Display,

source

fn with_context<D, F>(self, cfn: F) -> Self::WithContext
where D: Display, F: FnOnce() -> D,

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> Context for Result<T, ExecutionError>

§

type WithContext = Result<T, ExecutionError>

source§

fn context<D>( self, context: D, ) -> <Result<T, ExecutionError> as Context>::WithContext
where D: Display,

source§

fn with_context<D, F>( self, cfn: F, ) -> <Result<T, ExecutionError> as Context>::WithContext
where D: Display, F: FnOnce() -> D,

Implementors§