1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
//! Error types
//!
//! The general strategy of this crate is to avoid sum error types, or if
//! necessary to only include the variants that are actually possible for that
//! function.
//!

use std::fmt::Debug;

/// Error returned when the ID is invalid.
#[derive(Debug, Error, Eq, PartialEq)]
#[error(display = "ID {:?} is invalid", _0)]
pub struct InvalidIdError<I: Debug>(pub I);

/// Error returned when the operation failed because we ran out of the
/// resources.
#[derive(Debug, Error, Eq, PartialEq)]
#[error(display = "ran out of memory / resources")]
pub struct OomError;