[−][src]Enum gen_epub_book::Error
Enum representing all possible ways the application can fail.
Variants
IoAn I/O error occured.
This includes higher-level I/O errors like FS ones.
Fields of Io
ParseA parsing error occured.
Fields of Parse
FileNotFoundA requested file doesn't exist.
Fields of FileNotFound
WrongFileStateA path is in a wrong state.
Fields of WrongFileState
WrongElementAmountAn incorrect amount of book elements.
Fields of WrongElementAmount
RequiredElementMissing(&'static str)A required book element is missing.
Methods
impl Error[src]
pub fn print_error<W: Write>(&self, err_out: &mut W)[src]
Write the error message to the specified output stream.
Examples
let mut out = Vec::new(); Error::Io { desc: "network", op: "write", more: Some("full buffer"), }.print_error(&mut out); assert_eq!(String::from_iter(out.iter().map(|&i| i as char)), "Writing network failed: full buffer.\n".to_string());
pub fn exit_value(&self) -> i32[src]
Get the executable exit value from an Error instance.
Examples
assert_eq!(Error::Io { desc: "", op: "", more: None, }.exit_value(), 1);
Trait Implementations
impl PartialEq<Error> for Error[src]
impl Clone for Error[src]
fn clone(&self) -> Error[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Eq for Error[src]
impl Debug for Error[src]
impl Hash for Error[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T[src]
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>, [src]
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId[src]
impl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,