Enum chd::Error

source ·
#[repr(C)]
pub enum Error {
Show 29 variants None = 0, NoInterface = 1, OutOfMemory = 2, InvalidFile = 3, InvalidParameter = 4, InvalidData = 5, FileNotFound = 6, RequiresParent = 7, FileNotWriteable = 8, ReadError = 9, WriteError = 10, CodecError = 11, InvalidParent = 12, HunkOutOfRange = 13, DecompressionError = 14, CompressionError = 15, CantCreateFile = 16, CantVerify = 17, NotSupported = 18, MetadataNotFound = 19, InvalidMetadataSize = 20, UnsupportedVersion = 21, VerifyIncomplete = 22, InvalidMetadata = 23, InvalidState = 24, OperationPending = 25, NoAsyncOperation = 26, UnsupportedFormat = 27, Unknown = 28,
}
Expand description

Error types that may occur when reading a CHD file or hunk.

This type tries to be ABI-compatible with libchdr, given sane defaults in the C compiler. See repr(C) in the Rustonomicon for more details.

Variants§

§

None = 0

No error. This is only used by the C API bindings.

§

NoInterface = 1

No drive interface. This is only for C-compatibility purposes and is otherwise unused.

§

OutOfMemory = 2

Unable to allocate the required size of buffer.

§

InvalidFile = 3

The file is not a valid CHD file.

§

InvalidParameter = 4

An invalid parameter was provided.

§

InvalidData = 5

The data is invalid.

§

FileNotFound = 6

The file was not found.

§

RequiresParent = 7

This CHD requires a parent CHD that was not provided.

§

FileNotWriteable = 8

The provided file is not writable. Since chd-rs does not implement CHD creation, this is unused.

§

ReadError = 9

An error occurred when reading this CHD file.

§

WriteError = 10

An error occurred when writing this CHD file. Since chd-rs does not implement CHD creation, this is unused.

§

CodecError = 11

An error occurred when initializing a codec.

§

InvalidParent = 12

The provided parent CHD is invalid.

§

HunkOutOfRange = 13

The request hunk is out of range for this CHD file.

§

DecompressionError = 14

An error occurred when decompressing a hunk.

§

CompressionError = 15

An error occurred when compressing a hunk. Since chd-rs does not implement CHD creation, this is unused.

§

CantCreateFile = 16

Could not create the file. Since chd-rs does not implement CHD creation, this is unused.

§

CantVerify = 17

Could not verify the CHD. This is only for C-compatibility purposes and is otherwise unused.

§

NotSupported = 18

The requested operation is not supported. This is only for C-compatibility purposes and is otherwise unused.

§

MetadataNotFound = 19

The requested metadata was not found. This is only used by the C API bindings.

§

InvalidMetadataSize = 20

The metadata has an invalid size. This is only for C-compatibility purposes and is otherwise unused.

§

UnsupportedVersion = 21

The CHD version of the provided file is not supported by this library.

§

VerifyIncomplete = 22

Unable to verify the CHD completely. This is only for C-compatibility purposes and is otherwise unused.

§

InvalidMetadata = 23

The requested metadata is invalid.

§

InvalidState = 24

The internal state of the decoder/encoder is invalid. This is only for C-compatibility purposes and is otherwise unused.

§

OperationPending = 25

An operation is already pending. This is only for C-compatibility purposes and is otherwise unused.

§

NoAsyncOperation = 26

No async operations are allowed. This is only for C-compatibility purposes and is otherwise unused.

§

UnsupportedFormat = 27

Decompressing the CHD requires a codec that is not supported.

§

Unknown = 28

Unknown error.

Trait Implementations§

source§

impl Debug for Error

source§

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

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

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

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

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

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<BitReaderError> for Error

source§

fn from(_: BitReaderError) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<FromBytesWithNulError> for Error

source§

fn from(_: FromBytesWithNulError) -> Self

Converts to this type from the input type.
source§

impl From<HuffmanError> for Error

source§

fn from(_e: HuffmanError) -> Self

Converts to this type from the input type.
source§

impl From<TryFromSliceError> for Error

source§

fn from(_: TryFromSliceError) -> Self

Converts to this type from the input type.
source§

impl From<Utf8Error> for Error

source§

fn from(_: Utf8Error) -> Self

Converts to this type from the input type.

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.