Enum ResultCode

Source
#[repr(C)]
pub enum ResultCode {
Show 16 variants ANEURALNETWORKS_NO_ERROR = 0, ANEURALNETWORKS_OUT_OF_MEMORY = 1, ANEURALNETWORKS_INCOMPLETE = 2, ANEURALNETWORKS_UNEXPECTED_NULL = 3, ANEURALNETWORKS_BAD_DATA = 4, ANEURALNETWORKS_OP_FAILED = 5, ANEURALNETWORKS_BAD_STATE = 6, ANEURALNETWORKS_UNMAPPABLE = 7, ANEURALNETWORKS_OUTPUT_INSUFFICIENT_SIZE = 8, ANEURALNETWORKS_UNAVAILABLE_DEVICE = 9, ANEURALNETWORKS_MISSED_DEADLINE_TRANSIENT = 10, ANEURALNETWORKS_MISSED_DEADLINE_PERSISTENT = 11, ANEURALNETWORKS_RESOURCE_EXHAUSTED_TRANSIENT = 12, ANEURALNETWORKS_RESOURCE_EXHAUSTED_PERSISTENT = 13, ANEURALNETWORKS_DEAD_OBJECT = 14, INVALID_ERROR = 1_000,
}
Expand description

Result codes.

Any NNAPI function can return any result code, including result codes not currently documented. Any value other than {@link ANEURALNETWORKS_NO_ERROR} indicates a failure of some kind.

Additional information about the nature of a failure can be obtained from the device log after enabling NNAPI debugging by setting the debug.nn.vlog property to 1, e.g., by calling "adb shell setprop debug.nn.vlog 1".

Available since API level 27.

Variants§

§

ANEURALNETWORKS_NO_ERROR = 0

Operation was succesful.

§

ANEURALNETWORKS_OUT_OF_MEMORY = 1

Failure caused by not enough available memory.

§

ANEURALNETWORKS_INCOMPLETE = 2

Failure caused by not enough available memory.

§

ANEURALNETWORKS_UNEXPECTED_NULL = 3

Failure caused by unexpected null argument.

§

ANEURALNETWORKS_BAD_DATA = 4

Failure caused by invalid function arguments, invalid model definition, invalid execution definition or invalid data at execution time.

§

ANEURALNETWORKS_OP_FAILED = 5

Failure caused by failed model execution.

§

ANEURALNETWORKS_BAD_STATE = 6

Failure caused by object being in the wrong state.

§

ANEURALNETWORKS_UNMAPPABLE = 7

Failure caused by not being able to map a file into memory. This may be caused by a file descriptor not being mappable, or an AHardwareBuffer not supported by the device. Mitigate by reading its content into memory.

§

ANEURALNETWORKS_OUTPUT_INSUFFICIENT_SIZE = 8

Failure caused by insufficient buffer size provided to a model output.

§

ANEURALNETWORKS_UNAVAILABLE_DEVICE = 9

Failure caused by a device not being available.

§

ANEURALNETWORKS_MISSED_DEADLINE_TRANSIENT = 10

Failure because a deadline could not be met for a task, but future deadlines may still be met for the same task after a short delay.

Available since API level 30.

§

ANEURALNETWORKS_MISSED_DEADLINE_PERSISTENT = 11

Failure because a deadline could not be met for a task, and future deadlines will likely also not be met for the same task even after a short delay.

Available since API level 30.

§

ANEURALNETWORKS_RESOURCE_EXHAUSTED_TRANSIENT = 12

Failure because of a resource limitation within the driver, but future calls for the same task may still succeed after a short delay.

Available since API level 30.

§

ANEURALNETWORKS_RESOURCE_EXHAUSTED_PERSISTENT = 13

Failure because of a resource limitation within the driver, and future calls for the same task will likely also fail even after a short delay.

Available since API level 30.

§

ANEURALNETWORKS_DEAD_OBJECT = 14

Failure indicating an object is in a dead state.

Available since API level 30.

§

INVALID_ERROR = 1_000

This error code is not defined in NNAPI.

Implementations§

Source§

impl ResultCode

Source

pub fn as_str(&self) -> &'static str

Trait Implementations§

Source§

impl Debug for ResultCode

Source§

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

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

impl Display for ResultCode

Source§

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

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

impl Error for ResultCode

1.30.0 · Source§

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

Returns 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<i32> for ResultCode

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.

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> 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§

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>,

Source§

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>,

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.