Skip to main content

ResultExt

Trait ResultExt 

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

Extension trait for Result types to add error context

Required Methods§

Source

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

Source

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

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.

Implementations on Foreign Types§

Source§

impl<T> ResultExt<T> for Result<T, ShapeError>

Implementors§