This repository has been archived on 2022-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
ext2-rs/src/error.rs

23 lines
424 B
Rust
Raw Normal View History

2018-03-18 12:11:58 -05:00
/// Wrapper around the raw `ErrorKind`
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct Error {
kind: ErrorKind,
}
impl Error {
pub fn from_kind(kind: ErrorKind) -> Error {
Error { kind }
}
pub fn kind(&self) -> ErrorKind {
self.kind
}
}
/// The set of all possible errors
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum ErrorKind {
BadMagic,
OutOfBounds,
}