#[repr(C)]
pub enum Error {
Show 46 variants OK, NOMEM, ARCH, HANDLE, MODE, VERSION, OPT_INVALID, ASM_EXPR_TOKEN, ASM_DIRECTIVE_VALUE_RANGE, ASM_DIRECTIVE_ID, ASM_DIRECTIVE_TOKEN, ASM_DIRECTIVE_STR, ASM_DIRECTIVE_COMMA, ASM_DIRECTIVE_RELOC_NAME, ASM_DIRECTIVE_RELOC_TOKEN, ASM_DIRECTIVE_FPOINT, ASM_DIRECTIVE_UNKNOWN, ASM_DIRECTIVE_EQU, ASM_DIRECTIVE_INVALID, ASM_VARIANT_INVALID, ASM_EXPR_BRACKET, ASM_SYMBOL_MODIFIER, ASM_SYMBOL_REDEFINED, ASM_SYMBOL_MISSING, ASM_RPAREN, ASM_STAT_TOKEN, ASM_UNSUPPORTED, ASM_MACRO_TOKEN, ASM_MACRO_PAREN, ASM_MACRO_EQU, ASM_MACRO_ARGS, ASM_MACRO_LEVELS_EXCEED, ASM_MACRO_STR, ASM_MACRO_INVALID, ASM_ESC_BACKSLASH, ASM_ESC_OCTAL, ASM_ESC_SEQUENCE, ASM_ESC_STR, ASM_TOKEN_INVALID, ASM_INSN_UNSUPPORTED, ASM_FIXUP_INVALID, ASM_LABEL_INVALID, ASM_FRAGMENT_INVALID, ASM_INVALIDOPERAND, ASM_MISSINGFEATURE, ASM_MNEMONICFAIL,
}
Expand description

All type of errors encountered by Keystone API.

Variants

OK

No error: everything was fine.

NOMEM

Out-Of-Memory error: ks_open(), ks_emulate().

ARCH

Unsupported architecture: ks_open().

HANDLE

Invalid handle.

MODE

Invalid/unsupported mode: ks_open().

VERSION

Unsupported version (bindings).

OPT_INVALID

Unsupported option.

ASM_EXPR_TOKEN

Unknown token in expression.

ASM_DIRECTIVE_VALUE_RANGE

Literal value out of range for directive.

ASM_DIRECTIVE_ID

Expected identifier in directive.

ASM_DIRECTIVE_TOKEN

Unexpected token in directive.

ASM_DIRECTIVE_STR

Expected string in directive.

ASM_DIRECTIVE_COMMA

Expected comma in directive.

ASM_DIRECTIVE_RELOC_NAME

Expected relocation name in directive.

ASM_DIRECTIVE_RELOC_TOKEN

Unexpected token in .reloc directive.

ASM_DIRECTIVE_FPOINT

Invalid floating point in directive.

ASM_DIRECTIVE_UNKNOWN

Unknown directive.

ASM_DIRECTIVE_EQU

Invalid equal directive.

ASM_DIRECTIVE_INVALID

(Generic) invalid directive.

ASM_VARIANT_INVALID

Invalid variant.

ASM_EXPR_BRACKET

Brackets expression not supported on this target.

ASM_SYMBOL_MODIFIER

Unexpected symbol modifier following ‘@’.

ASM_SYMBOL_REDEFINED

Invalid symbol redefinition.

ASM_SYMBOL_MISSING

Cannot find a symbol.

ASM_RPAREN

Expected ‘)’ in parentheses expression.

ASM_STAT_TOKEN

Unexpected token at start of statement.

ASM_UNSUPPORTED

Unsupported token yet.

ASM_MACRO_TOKEN

Unexpected token in macro instantiation.

ASM_MACRO_PAREN

Unbalanced parentheses in macro argument.

ASM_MACRO_EQU

Expected ‘=’ after formal parameter identifier.

ASM_MACRO_ARGS

Too many positional arguments.

ASM_MACRO_LEVELS_EXCEED

Macros cannot be nested more than 20 levels deep.

ASM_MACRO_STR

Invalid macro string.

ASM_MACRO_INVALID

Invalid macro (generic error).

ASM_ESC_BACKSLASH

Unexpected backslash at end of escaped string.

ASM_ESC_OCTAL

Invalid octal escape sequence (out of range).

ASM_ESC_SEQUENCE

Invalid escape sequence (unrecognized character).

ASM_ESC_STR

Broken escape string.

ASM_TOKEN_INVALID

Invalid token.

ASM_INSN_UNSUPPORTED

This instruction is unsupported in this mode.

ASM_FIXUP_INVALID

Invalid fixup.

ASM_LABEL_INVALID

Invalid label.

ASM_FRAGMENT_INVALID

Invalid fragment.

ASM_INVALIDOPERAND

Generic input assembly errors (invalid operand) - architecture specific.

ASM_MISSINGFEATURE

Generic input assembly errors (missing feature) - architecture specific.

ASM_MNEMONICFAIL

Generic input assembly errors (mnemonic fail) - architecture specific.

Implementations

Returns the latest error recorded error, if any.

Returns a description for a given Keystone error.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
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.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

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.

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.