1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//! Error types and utilities.

#[derive(thiserror::Error, Debug)]
/// Represents an error that can occur in the application.
pub enum Error {
    /// An I/O error occurred.
    #[error("i/o error {0}")]
    Io(#[from] std::io::Error),

    /// An internal error occurred.
    #[error("internal error")]
    Internal,

    #[error("operation not supported when input is in-progress")]
    InProgress,

    #[error("operation not implemented")]
    Unimplemented,
}

/// A specialized [Result] type for this crate's operations.
pub type Result<T, E = Error> = std::result::Result<T, E>;