Skip to main content

ResultExt

Trait ResultExt 

Source
pub trait ResultExt<T> {
    // Required methods
    fn with_location(self, location: SourceLocation) -> Result<T>;
    fn with_context(self, msg: impl Into<String>) -> Result<T>;
}
Expand description

Extension trait for Result types to add error context

Required Methods§

Source

fn with_location(self, location: SourceLocation) -> Result<T>

Source

fn with_context(self, msg: impl Into<String>) -> Result<T>

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.

Implementors§

Source§

impl<T> ResultExt<T> for Result<T>