#[non_exhaustive]pub enum ErrorKind {
General,
Io,
InvalidParameter,
UnsupportedVersion,
UnknownVersion,
UnsupportedFeature,
BitstreamVersionUnsupported,
Buffer,
AllocationExceedsInput,
LimitExceeded,
}Expand description
What a DracoError refused, as a value that can be compared and copied.
Separate from the error itself so that the error can stay one pointer wide:
the kind and its message live together behind a single allocation, and
Result<(), DracoError> is a pointer-sized value returned in a register.
See DracoError for why that matters.
Non-exhaustive: a decoder that learns to tell one refusal from another
should be able to say so without a major release. Match with a _ arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
General
Generic error.
Mirrors upstream’s Status::DRACO_ERROR, whose own comment reads “used
for general errors”.
Io
File or stream I/O error.
InvalidParameter
Invalid caller-provided parameter.
UnsupportedVersion
Bitstream version is known but unsupported.
UnknownVersion
Bitstream version could not be identified.
UnsupportedFeature
Bitstream uses a feature this crate does not support.
BitstreamVersionUnsupported
Bitstream version is outside the supported range.
Buffer
Buffer read or write failed.
AllocationExceedsInput
A decode would allocate more than the stream it is reading could plausibly describe.
The bound is a ratio against the input size, not a cap on geometry — see
decode_budget. A stream that trips it is malformed or adversarial; a
large but genuine mesh scales its own budget with it.
LimitExceeded
A decode would produce more than the caller’s DecodeLimits allow.
Distinct from AllocationExceedsInput
on purpose: that one says the file is malformed, this one says the file
may well be fine and the caller declined to decode something that
large. Raise the limits, or use
DecodeLimits::permissive.