[][src]Enum xdrfile::Error

pub enum Error {
    CApiError {
        code: ErrorCode,
        task: ErrorTask,
    },
    WrongSizeFrame {
        expected: usize,
        found: usize,
    },
    CouldNotOpen {
        path: PathBuf,
        mode: FileMode,
    },
    InvalidOsStr(Option<NulError>),
    CouldNotCheckNAtoms(Box<Error>),
    OutOfRange {
        name: &'static str,
        task: ErrorTask,
        value: String,
        target: &'static str,
    },
}

Error type for the xdrfile library

Variants

CApiError

An error code from the C API

Fields of CApiError

code: ErrorCodetask: ErrorTask
WrongSizeFrame

Passed in a frame of the wrong size

Fields of WrongSizeFrame

expected: usizefound: usize
CouldNotOpen

C API failed to open a file (No return code provided)

Fields of CouldNotOpen

path: PathBufmode: FileMode
InvalidOsStr(Option<NulError>)

A path could not be converted to &OsStr

CouldNotCheckNAtoms(Box<Error>)

Checking the number of atoms failed while reading a frame

OutOfRange

Error for an out-of-range numeric conversion

Fields of OutOfRange

name: &'static strtask: ErrorTaskvalue: Stringtarget: &'static str

Implementations

impl Error[src]

pub fn code(&self) -> Option<ErrorCode>[src]

Get the error code returned by the C API, if any

pub fn task(&self) -> Option<ErrorTask>[src]

Get the task being attempted when the C API returned an error, if any

pub fn is_eof(&self) -> bool[src]

True if the error is an end of file error, false otherwise

Trait Implementations

impl Clone for Error[src]

impl Debug for Error[src]

impl Display for Error[src]

impl Error for Error[src]

impl<'_> From<(&'_ Frame, usize)> for Error[src]

impl<'_> From<(&'_ Path, FileMode)> for Error[src]

impl From<(ErrorCode, ErrorTask)> for Error[src]

impl PartialEq<Error> for Error[src]

impl StructuralPartialEq for Error[src]

Auto Trait Implementations

impl RefUnwindSafe for Error

impl Send for Error

impl Sync for Error

impl Unpin for Error

impl UnwindSafe for Error

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.