Expand description
Captured MLX-C error translation.
MLX C reports an error immediately before returning nonzero on the same
calling thread, so the capture machinery pairs those two observations
thread-locally. This module only translates what MLX-C reported; typed
classification of embedding-specific error markers (for example an
active memory ceiling) is embedding policy: the consumer converts
MlxCError values at its own boundary.
Payload trampolines cannot return Rust errors across the C ABI, so they park their typed failure in a separate thread-local slot and return nonzero; status translation prefers that parked failure because it is the root cause, while MLX-C’s status text only reports that a callback errored.
Structs§
- MlxC
Error - One failed MLX-C operation: what was attempted and what MLX-C reported.
Functions§
- check_
status - Translates an MLX-C status into
Ok(())or a capturedMlxCError. - clear_
captured_ mlx_ error - Discards the captured MLX-C error description for the calling thread.
- clear_
closure_ error - Discards the parked payload-closure failure for the calling thread.
- install_
non_ terminating_ error_ handler - Installs the non-terminating MLX-C error handler exactly once per process.
- set_
closure_ error - Parks a payload-closure failure for the calling thread’s status check.
- take_
captured_ mlx_ error - Takes the captured MLX-C error description for the calling thread, if any.
- take_
closure_ error - Takes the parked payload-closure failure for the calling thread, if any.