Skip to main content

Result

Type Alias Result 

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

Type alias for Results with the flag Error type

This is a convenience type alias for std::result::Result<T, flag::Error>.

§Examples

use flag_rs::error::{Error, Result};

fn parse_count(s: &str) -> Result<u32> {
    s.parse()
        .map_err(|_| Error::ArgumentParsing(format!("invalid count: {}", s)))
}

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