Enum sdf::error::Error [] [src]

pub enum Error {
    BadArg(String),
    EndOfFile(String),
    InvalidChannel(u32),
    Io(Error),
    MissingChannel(Channel),
    MissingIndex(String),
    NoCalibrationTableForChannel(Channel),
    NotImplemented(String),
    Nul(NulError),
    Runtime(String),
    Sdc(Error),
    NeedSingleReferencePeak(usize),
    Utf8(Utf8Error),
    UnknownCode(i32),
    UnknownException(String),
    UnsupportedFormat(String),
}

Our error type.

Variants

BadArg

A bad argument has been passed to sdfifc.

EndOfFile

The end of an sdf file has been reached.

InvalidChannel

The specified channel is invalid.

Io

A wrapper around a std::io::Error.

MissingChannel

The channel is a valid channel, but we couldn't find it when we tried.

MissingIndex

The sdf file is missing an index.

Some file-based operations, namely reads and seeks, require an index. Use File::reindex() to create one.

NoCalibrationTableForChannel

There is no calibration table for the given channel.

NotImplemented

The given function is unimplemented by sdfifc.

Nul

A wrapper around std::ffi::NulError.

Runtime

A runtime error on the part of sdfifc.

Sdc

A wrapper around sdc::Error.

NeedSingleReferencePeak

Either zero or more than one reference peak.

Utf8

A wrapper around std::str::Utf8Error.

UnknownCode

An unknown code has been provided to an error-mapping routine.

UnknownException

An unknown exception has occurred inside sdfifc.

UnsupportedFormat

The given sdf file is not in a supported format.

Methods

impl Error

fn from_i32(code: i32) -> Error

Converts an i32 error code to an Error.

This function also calls last_error to get the error message from fwifc.

Panics

Panics if you pass in zero. That's because zero is not an error, and your code should not be trying to create an error if there isn't one.

Trait Implementations

impl Error for Error

fn description(&self) -> &str

fn cause(&self) -> Option<&Error>

impl Display for Error

fn fmt(&self, f: &mut Formatter) -> Result

impl From<Error> for Error

fn from(err: Error) -> Error

impl From<NulError> for Error

fn from(err: NulError) -> Error

impl From<Error> for Error

fn from(err: Error) -> Error

impl From<Utf8Error> for Error

fn from(err: Utf8Error) -> Error

Derived Implementations

impl Debug for Error

fn fmt(&self, __arg_0: &mut Formatter) -> Result