37 lines
683 B
Rust
37 lines
683 B
Rust
#[macro_use]
|
|
mod macros;
|
|
|
|
mod app;
|
|
pub mod ui;
|
|
|
|
use std::error::Error;
|
|
use std::fmt::{Debug, Display};
|
|
|
|
pub use app::*;
|
|
pub use app::{App, Command, Opt};
|
|
|
|
pub type Result<T> = std::result::Result<T, ArkhamError>;
|
|
|
|
#[derive(Debug)]
|
|
pub enum ArkhamError {
|
|
IO(String),
|
|
Other(String),
|
|
}
|
|
|
|
impl Error for ArkhamError {}
|
|
|
|
impl Display for ArkhamError {
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
match self {
|
|
Self::Other(v) => f.write_str(v),
|
|
Self::IO(v) => f.write_str(v),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl From<std::io::Error> for ArkhamError {
|
|
fn from(fr: std::io::Error) -> Self {
|
|
Self::IO(fr.to_string())
|
|
}
|
|
}
|