ito-core 0.1.29

Core functionality and business logic for Ito
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Bridges domain errors into core errors.

use crate::errors::CoreError;
use ito_domain::errors::DomainError;

/// Convert domain results into core-level results.
pub trait IntoCoreResult<T> {
    /// Convert `Result<T, DomainError>` into `Result<T, CoreError>`.
    fn into_core(self) -> Result<T, CoreError>;
}

impl<T> IntoCoreResult<T> for Result<T, DomainError> {
    fn into_core(self) -> Result<T, CoreError> {
        self.map_err(CoreError::from)
    }
}