Result

Type Alias Result 

Source
pub type Result<T> = Result<T, Error>;
Expand description

Type alias for Result<T, Error>.

This provides a convenient shorthand for functions that return the framework’s error type.

§Example

use ignitia::Result;

fn validate_email(email: &str) -> Result<String> {
    if email.contains('@') {
        Ok(email.to_string())
    } else {
        Err(Error::validation("Invalid email format"))
    }
}

Aliased Type§

pub enum Result<T> {
    Ok(T),
    Err(Error),
}

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(Error)

Contains the error value