Skip to main content

StoreResultExt

Trait StoreResultExt 

Source
pub trait StoreResultExt<T> {
    // Required method
    fn store_err(self) -> Result<T>;
}
Expand description

Extension trait that converts any Result<T, E: Display> into Result<T, AgentLoopError> via AgentLoopError::store(e.to_string()).

Replaces the boilerplate pattern:

.map_err(|e| AgentLoopError::store(e.to_string()))?

with:

.store_err()?

Required Methods§

Source

fn store_err(self) -> Result<T>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T, E: Display> StoreResultExt<T> for Result<T, E>

Source§

fn store_err(self) -> Result<T>

Implementors§