apiplant-abi 0.1.0

Stable C-ABI contract between apiplant and dynamically-loaded functions
Documentation
  • Coverage
  • 90%
    126 out of 140 items documented0 out of 61 items with examples
  • Size
  • Source code size: 47.67 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.52 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 22s Average build duration of successful builds.
  • all releases: 22s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • framp

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.