apiplant-abi 0.2.0

Stable C-ABI contract between apiplant and dynamically-loaded functions
Documentation

apiplant-abi

The stable, C-compatible ABI contract that sits between the apiplant host and every dynamically-loaded function library (.so/.dylib/.dll).

Both sides depend only on this crate and on [abi_stable], which means a function compiled against version X of this crate keeps working against a host compiled against the same major version — no matter which compiler, allocator or std version each side was built with. That is the whole point of routing everything through #[repr(C)] + [StableAbi] types.

The shape of a function

A function library exports exactly one root module ([FunctionMod]) whose new_functions constructor yields one or more [Function] trait objects — a single library can provide a whole set of independently-named functions. For each of them the host:

  1. reads its [FunctionManifest] (name, visibility, HTTP method, config schema),
  2. mounts it on an HTTP endpoint according to its [Visibility],
  3. on each request calls [Function::invoke], passing a [HostApi] handle (database access, logging, resolved config) plus a JSON input string,
  4. returns the JSON the function produced.

Everything crosses the boundary as JSON ([RString]) or as small #[repr(C)] enums. Nothing sea-orm / ntex / tokio ever touches the ABI, so the contract stays tiny and genuinely stable.