Skip to main content

EfErrorClass

Enum EfErrorClass 

Source
#[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.

Trait Implementations§

Source§

impl Clone for EfErrorClass

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for EfErrorClass

Source§

impl Debug for EfErrorClass

Source§

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

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

impl Default for EfErrorClass

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for EfErrorClass

Source§

impl PartialEq for EfErrorClass

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for EfErrorClass

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.