#[repr(C)]
pub enum chd_error {
Show 29 variants None, NoInterface, OutOfMemory, InvalidFile, InvalidParameter, InvalidData, FileNotFound, RequiresParent, FileNotWriteable, ReadError, WriteError, CodecError, InvalidParent, HunkOutOfRange, DecompressionError, CompressionError, CantCreateFile, CantVerify, NotSupported, MetadataNotFound, InvalidMetadataSize, UnsupportedVersion, VerifyIncomplete, InvalidMetadata, InvalidState, OperationPending, NoAsyncOperation, UnsupportedFormat, Unknown,
}
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

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

NoInterface

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

OutOfMemory

Unable to allocate the required size of buffer.

InvalidFile

The file is not a valid CHD file.

InvalidParameter

An invalid parameter was provided.

InvalidData

The data is invalid.

FileNotFound

The file was not found.

RequiresParent

This CHD requires a parent CHD that was not provided.

FileNotWriteable

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

ReadError

An error occurred when reading this CHD file.

WriteError

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

CodecError

An error occurred when initializing a codec.

InvalidParent

The provided parent CHD is invalid.

HunkOutOfRange

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

DecompressionError

An error occurred when decompressing a hunk.

CompressionError

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

CantCreateFile

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

CantVerify

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

NotSupported

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

MetadataNotFound

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

InvalidMetadataSize

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

UnsupportedVersion

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

VerifyIncomplete

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

InvalidMetadata

The requested metadata is invalid.

InvalidState

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

OperationPending

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

NoAsyncOperation

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

UnsupportedFormat

Decompressing the CHD requires a codec that is not supported.

Unknown

Unknown error.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

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

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

🔬 This is a nightly-only experimental API. (error_generic_member_access)

Provides type based access to context intended for error reports. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.