Skip to main content

Result

Type Alias Result 

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

A specialized Result type for this crate.

All fallible operations in dynamodb-facade return this type.

§Examples

use dynamodb_facade::{Error, Result};

fn validate_role(role: &str) -> Result<()> {
    if role.is_empty() {
        return Err(Error::custom("role must not be empty"));
    }
    Ok(())
}

assert!(validate_role("student").is_ok());
assert!(validate_role("").is_err());

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