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 |
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 |
NoCalibrationTableForChannel | There is no calibration table for the given channel. |
NotImplemented | The given function is unimplemented by sdfifc. |
Nul | A wrapper around |
Runtime | A runtime error on the part of sdfifc. |
Sdc | A wrapper around |
NeedSingleReferencePeak | Either zero or more than one reference peak. |
Utf8 | A wrapper around |
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.