Skip to main content

Crate hurray_ffi

Crate hurray_ffi 

Source
Expand description

§hurray-ffi

C ABI layer for hurray language bindings.

This crate exposes opaque handles, a function table, and buffer release callbacks via a stable C ABI. It is the foundation for all non-Rust language bindings.

§Safety contract

  • No panics may propagate across the FFI boundary. All extern "C" functions wrap their bodies in std::panic::catch_unwind.
  • All unsafe blocks carry a // SAFETY: comment explaining soundness.
  • Buffer pointers MUST be aligned to at least 64 bytes.

§C ABI version

The C ABI version is exposed via HURRAY_C_ABI_VERSION and the function hurray_c_abi_version. Callers SHOULD check this at startup to detect incompatible library versions.

Re-exports§

pub use buffer::hurray_buffer_from_ptr;
pub use buffer::HurrayBuffer;
pub use buffer::HurrayReleaseCallback;
pub use buffer_list::hurray_buffer_list_new;
pub use buffer_list::HurrayBufferList;
pub use descriptor::hurray_descriptor_decode;
pub use descriptor::HurrayDescriptor;
pub use status::HurrayStatus;
pub use status::HURRAY_ERR_BUFFER_TOO_SMALL;
pub use status::HURRAY_ERR_INDEX_OUT_OF_BOUNDS;
pub use status::HURRAY_ERR_INTERNAL;
pub use status::HURRAY_ERR_INTERNAL_PANIC;
pub use status::HURRAY_ERR_INVALID_LAYOUT;
pub use status::HURRAY_ERR_INVALID_MAGIC;
pub use status::HURRAY_ERR_INVALID_SYNC_MODE;
pub use status::HURRAY_ERR_INVALID_TYPE;
pub use status::HURRAY_ERR_NULL_POINTER;
pub use status::HURRAY_ERR_SYNC_MODE_MISMATCH;
pub use status::HURRAY_ERR_VERSION_MISMATCH;
pub use status::HURRAY_OK;
pub use sync::HurrayEventReleaseFn;
pub use sync::HurraySyncConsumerStreamPayload;
pub use sync::HurraySyncEventPayload;
pub use tensor_context::hurray_tensor_context_new;
pub use tensor_context::HurrayOwnerReleaseFn;
pub use tensor_context::HurrayTensorContext;

Modules§

buffer
Opaque buffer handle for the Hurray C ABI.
buffer_list
Opaque list of buffer handles for multi-buffer tensors (ADR-030).
descriptor
Opaque tensor descriptor handle for the Hurray C ABI.
status
Status codes and error mapping for the Hurray C ABI.
sync
Synchronization mode handoff cross-checks for the Hurray C ABI.
tensor_context
Opaque carrier for everything a native-protocol capsule holds beyond its buffers (ADR-034).

Structs§

HurrayReader
Opaque handle to an async streaming reader (full implementation deferred).
HurrayWriter
Opaque handle to an async streaming writer (full implementation deferred).

Constants§

HURRAY_C_ABI_VERSION
The integer version of the Hurray C ABI exposed by this build.

Functions§

hurray_c_abi_version
Returns the HURRAY_C_ABI_VERSION constant.