Enum in ffi compiler

ErrorKind

enum ErrorKind
Import
use ffi::{ErrorKind};
Source: compiler/src/builtin_docs/ffi.hy

The category of an FFI failure, read from Error.kind.

Match on it to recover from a specific failure; use Error.message for display. It implements Show, so format("%v", k) gives the variant name.

Variants#

LibraryNotFound#

The library passed the load gate but no file was found for it.

SymbolNotFound#

declare named a symbol the library does not export.

ArityMismatch#

invoke got a different number of arguments than declare gave (fewer than the fixed prefix, for a variadic function).

Libffi#

libffi rejected the call signature.

InvalidSignature#

The signature is malformed: an empty or missing name, no return type, or Void used as an argument type.

InvalidHandle#

A library handle or function id is not one dload / declare returned.

Unsupported#

The call cannot be marshalled: an unsupported tag or value (such as Bytes as a return type), a string with a NUL byte, or a read_ints count out of range or null pointer.

Other#

Anything else, including a library the load gate denied.

Examples#

use ffi::{ErrorKind};
use string::{format};
use tests::assert;
assert!(format("%v", ErrorKind::SymbolNotFound) == "SymbolNotFound");

See also#

↑ ↓ navigate ↵ open