feat: add kxio::Result;
This commit is contained in:
parent
742924e44c
commit
17c1b4ff6d
2 changed files with 17 additions and 0 deletions
|
@ -1,3 +1,6 @@
|
||||||
//
|
//
|
||||||
pub mod fs;
|
pub mod fs;
|
||||||
pub mod net;
|
pub mod net;
|
||||||
|
mod result;
|
||||||
|
|
||||||
|
pub use result::{Error, Result};
|
||||||
|
|
14
src/result.rs
Normal file
14
src/result.rs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
//
|
||||||
|
use derive_more::{Display, From};
|
||||||
|
|
||||||
|
/// Represents a error accessing the file system or network.
|
||||||
|
#[derive(Debug, From, Display)]
|
||||||
|
pub enum Error {
|
||||||
|
Fs(#[from] crate::fs::Error),
|
||||||
|
Net(#[from] crate::net::Error),
|
||||||
|
Reqwest(#[from] reqwest::Error),
|
||||||
|
}
|
||||||
|
impl std::error::Error for Error {}
|
||||||
|
|
||||||
|
/// Represents a success or a failure using `fs` or `net`.
|
||||||
|
pub type Result<T> = core::result::Result<T, Error>;
|
Loading…
Reference in a new issue