Skip to main content

Result

Type Alias Result 

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

A specialized Result whose error is IqdbError.

§Examples

use iqdb_types::{IqdbError, Result};

fn require_non_empty(dim: usize) -> Result<()> {
    if dim == 0 {
        return Err(IqdbError::InvalidConfig { reason: "dim must be greater than zero" });
    }
    Ok(())
}

assert!(require_non_empty(0).is_err());
assert!(require_non_empty(3).is_ok());

Aliased Type§

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

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(IqdbError)

Contains the error value