Trait graphql_starter::error::MapToErr

source ·
pub trait MapToErr<T> {
    // Required methods
    fn map_to_internal_err(self, reason: impl Into<String>) -> Result<T>;
    fn map_to_err(
        self,
        code: impl ErrorInfo + Send + Sync + 'static,
        reason: impl Into<String>,
    ) -> Result<T>;
}
Expand description

Utility trait to map any Result<T,E> to a Result<T, Box<Error>>

Required Methods§

source

fn map_to_internal_err(self, reason: impl Into<String>) -> Result<T>

Maps the error to an internal server error

source

fn map_to_err( self, code: impl ErrorInfo + Send + Sync + 'static, reason: impl Into<String>, ) -> Result<T>

Maps the error to the given one

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T, E: Display + Send + Sync + 'static> MapToErr<T> for Result<T, E>