Module cglue::result [−][src]
Expand description
Describes a FFI safe result.
This module contains several key parts:
CResult
It is a simple #[repr(C)]
enum that is equivalent and interchangeable with Result
.
IntError
IntError is a type that allows for efficient FFI-boundary crossing
and simple interop with C code. It takes a Result<T, E>
, and splits it up to 2 distinct parts
ok_out
pointer, and an integer return value. Value of zero always means success, and thatok_out
was filled, whereas any other value can represent a specific meaningE
must specify by itself.
IntResult
It is a helper trait that is implemented on all Result<T, E>
types where E
implements
IntError.
Enums
CResult | FFI safe result. |
Traits
IntError | Represents an integer-convertable error value. |
IntResult | Helper trait for integer errors. |
Functions
from_int_result⚠ | Convert from error code to concrete result. |
from_int_result_empty | Convert from error code to Ok or Err. |
into_int_out_result | Convert result into an integer error value, potentially writing the Ok value. |
into_int_result | Convert result into an integer error value. |