pub trait NodeContextExt<T, Context>: Sized {
type Error: Into<Box<dyn Error>>;
// Required method
fn with_node_context<Function, NewError>(
self,
ctx: &Context,
f: Function,
) -> Result<T, NodeError>
where Function: FnOnce(Self::Error) -> NewError,
NewError: Into<Box<dyn Error>>;
// Provided methods
fn node_context(self, ctx: &Context) -> Result<T, NodeError> { ... }
fn node_context_message(
self,
ctx: &Context,
message: &str,
) -> Result<T, NodeError> { ... }
}
Required Associated Types§
Required Methods§
fn with_node_context<Function, NewError>( self, ctx: &Context, f: Function, ) -> Result<T, NodeError>
Provided Methods§
fn node_context(self, ctx: &Context) -> Result<T, NodeError>
fn node_context_message( self, ctx: &Context, message: &str, ) -> Result<T, NodeError>
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.