#[repr(u32)]pub enum EfErrorClass {
Unspecified = 0,
InvalidArgument = 1,
InvalidShape = 2,
InsufficientCapacity = 3,
BatchIndexOutOfBounds = 4,
RegionOutOfBounds = 5,
NotSupported = 6,
InvalidOperation = 7,
AllocationFailed = 8,
QuantizationInvalid = 9,
}Expand description
Which kind of failure the calling thread’s last failing
ef_tensor_* call was.
The companion to ef_tensor_last_error_message, and the reason it
exists: an entry point that reports failure by returning NULL has no
errno to carry a class, so a Rust consumer rebuilding a typed
edgefirst_tensor::Error from it had nothing to go on but the advisory
message – which the message’s own contract says must never be parsed.
ef_tensor_batch really did match on a fragment of a Display string
for exactly this reason.
A class, not a one-to-one mirror of edgefirst_tensor::Error. Its
variants are the distinctions a caller acts on differently; several Rust
variants deliberately collapse into one here, and adding a Rust variant
does not oblige adding one here. Unspecified is the honest answer when
a failure path recorded only a message, and is what every such path
resets this to – a stale class from an earlier failure would be read as
this call’s, which is the confident-falsehood shape this whole mechanism
exists to remove.
Variants§
Unspecified = 0
No class recorded for this failure; the message is all there is.
InvalidArgument = 1
A caller argument was malformed, out of range, or not recognized.
InvalidShape = 2
A shape was rejected: wrong rank, wrong element count, or not a shape the format admits.
InsufficientCapacity = 3
A shape or window did not fit the allocation behind it.
BatchIndexOutOfBounds = 4
An index was outside the leading (batch) dimension.
RegionOutOfBounds = 5
A spatial region did not fit inside its parent frame.
NotSupported = 6
The operation is not available for this tensor’s backing, on this platform, or in this build.
InvalidOperation = 7
The operation is legal but not permitted right now – a live map, a shared handle, a lock another holder owns.
AllocationFailed = 8
An allocation failed, or a syscall backing one did.
QuantizationInvalid = 9
A quantization payload was rejected.