cgp-error-std 0.3.0

Context-generic programming error handlers implemented using `std::error::Error`
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use core::error::Error as StdError;

use cgp_core::error::ErrorRaiser;
use cgp_core::prelude::*;

use crate::types::Error;

pub struct RaiseBoxedStdError;

impl<Context, E> ErrorRaiser<Context, E> for RaiseBoxedStdError
where
    Context: HasErrorType<Error = Error>,
    E: StdError + Send + Sync + 'static,
{
    fn raise_error(e: E) -> Error {
        e.into()
    }
}