Expand description
The stable C ABI runtime: the error struct, memory helpers, reference-counted objects, cancel tokens, callback-interface vtables, iterators, the value-buffer codec, and the async executor hook.
Producers rarely name these items. The #[weaveffi::module] expansion
and export_runtime! call into them as
::weaveffi::abi::*, so every unsafe pointer operation a producer
performs has one audited home. The normative description of the contract
this module implements is docs/src/reference/abi.md in the WeaveFFI
repository.
Re-exports§
pub use buffer::decode_value;pub use buffer::encode_value;pub use buffer::BufferDecodeError;pub use buffer::BufferReader;pub use buffer::BufferValue;pub use buffer::BufferWriter;pub use buffer::ByValue;pub use buffer::FixedWidth;pub use callback::callback_ret_buffer;pub use callback::callback_ret_bytes;pub use callback::callback_ret_enum;pub use callback::callback_ret_object;pub use callback::callback_ret_object_opt;pub use callback::callback_ret_string;pub use callback::callback_status;pub use callback::callback_status_in;pub use callback::lift_callback;pub use callback::lift_callback_opt;pub use callback::CallbackInterface;pub use callback::ForeignCallback;pub use callback::ForeignError;pub use callback::Vtable;pub use callback::VtableHeader;pub use callback::VtableTooSmall;pub use cancel::cancel_token_cancel;pub use cancel::cancel_token_create;pub use cancel::cancel_token_destroy;pub use cancel::cancel_token_is_cancelled;pub use cancel::AtomicWaker;pub use cancel::CancelToken;pub use cancel::Cancellable;pub use cancel::FfiCancelToken;pub use contract::contract_compact;pub use contract::contract_len;pub use contract::contract_table;pub use contract::ContractEntry;pub use convert::adopt_bytes;pub use convert::alloc;pub use convert::bytes_into_raw;pub use convert::free_bytes;pub use convert::lift_byte_slice;pub use convert::lift_bytes;pub use convert::lift_str;pub use convert::lift_string;pub use convert::lower_bytes;pub use convert::lower_string;pub use error::boxed_error;pub use error::error_clear;pub use error::error_free;pub use error::error_set;pub use error::error_set_c;pub use error::error_set_payload_c;pub use error::error_store;pub use error::panic_message;pub use error::ErrorDomain;pub use error::ErrorReport;pub use error::FfiError;pub use error::CANCELLED_ERROR_CODE;pub use error::FOREIGN_ERROR_CODE;pub use error::GENERIC_ERROR_CODE;pub use error::MARSHAL_ERROR_CODE;pub use error::PANIC_ERROR_CODE;pub use iter::iter_destroy;pub use iter::iter_into_raw;pub use iter::iter_next;pub use iter::Iter;pub use iter::IterHandle;pub use leak::debug_live;pub use marshal::buffer_run;pub use marshal::byte_slots;pub use marshal::bytes_run;pub use marshal::call_sync;pub use marshal::lift_buffer_param;pub use marshal::lift_bytes_param;pub use marshal::lift_callback_opt_param;pub use marshal::lift_callback_param;pub use marshal::lift_enum;pub use marshal::lift_object_arc_opt_param;pub use marshal::lift_object_arc_param;pub use marshal::lift_object_opt_param;pub use marshal::lift_object_param;pub use marshal::lift_self;pub use marshal::lift_self_arc;pub use marshal::lift_slice_param;pub use marshal::lift_str_param;pub use marshal::lift_string_param;pub use marshal::lower_buffer_ret;pub use marshal::lower_bytes_ret;pub use marshal::lower_string_ret;pub use marshal::read_enum;pub use marshal::str_slots;pub use marshal::string_run;pub use marshal::write_enum;pub use marshal::CEnum;pub use marshal::Sentinel;pub use object::lower_object;pub use object::lower_object_opt;pub use object::object_arc;pub use object::object_clone;pub use object::object_destroy;pub use object::object_from_token;pub use object::object_ref;pub use object::object_to_token;pub use spawn::block_on;pub use spawn::default_pool_size;pub use spawn::launch_async;pub use spawn::run_async;pub use spawn::set_spawner;pub use spawn::spawn;pub use spawn::BoxFuture;pub use spawn::CatchUnwind;pub use spawn::SpawnError;pub use spawn::Spawner;pub use spawn::SpawnerAlreadySet;
Modules§
- buffer
- The WeaveFFI value-buffer protocol: the by-value serialization format records, rich enums, optionals, lists, maps, and error payloads use to cross the C ABI.
- callback
- Consumer-implemented callback interfaces: the producer half of the ABI’s vtable contract.
- cancel
- Reference-counted cancel tokens and the future combinator that makes cancellation of an async call observable.
- contract
- Contract tables: the per-declaration fingerprints a consumer checks when it loads the library.
- convert
- Marshalling helpers that bridge Rust values and the C ABI’s
(ptr, len)slots. - error
- The error struct every fallible symbol reports through, the reserved
runtime codes, and the
ErrorReportmapping from producer errors. - iter
- Lazily pulled iterators: the producer’s
Iterand the opaque handle a launcher returns for it. - leak
- Debug leak counters behind the
leak-checkcargo feature. - marshal
- The glue every generated thunk calls: per-family parameter lifting, return lowering, and the synchronous call driver.
- object
- Reference-counted interface objects: the producer half of the ABI’s object model.
- spawn
- The pluggable executor async exports run on, and the launcher driver that keeps the completion promise.
Constants§
- ABI_
VERSION - The revision of the WeaveFFI C ABI this runtime implements.