Expand description
§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:
- reads its
FunctionManifest(name, visibility, HTTP method, config schema), - mounts it on an HTTP endpoint according to its
Visibility, - on each request calls
Function::invoke, passing aHostApihandle (database access, logging, resolved config) plus a JSON input string, - 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.
Modules§
- Function_
trait - This module is generated by the
#[sabi_trait]attribute on Function - Host
Api_ trait - This module is generated by the
#[sabi_trait]attribute on HostApi - c
- A plain C ABI, for functions written in something other than Rust.
Structs§
- Function
Manifest - Static description of a function, read once at load time.
- Function
Mod - The root module every function library exports.
- Function
Mod_ Prefix - This is the prefix fields of
FunctionMod, accessible throughFunctionMod_Ref, with.0.prefix(). - Function
Mod_ Ref - This is the pointer to the prefix of
FunctionMod. - Function_
TO - The trait object for Function.
- Host
Api_ TO - The trait object for HostApi.
Enums§
- Function
Access - A function’s effective access policy — the resolved form of
FunctionManifest::permission, falling back toVisibility. - Http
Method - HTTP verb a function endpoint responds to.
- LogLevel
- Severity for
HostApi::log. - Visibility
- Who is allowed to call a function’s (or resource’s) endpoint.
Constants§
- INTERNAL_
ERROR_ PREFIX - Marks an
Function::invokeerror as the function’s own fault — a panic or an internal fault — rather than a complaint about the caller’s input.
Traits§
- Function
- A loaded function instance. Constructed once per library via
FunctionMod::new_functionsand reused across requests, so it must beSend + Sync. - HostApi
- Services the host lends to a function for the duration of one invocation.
Type Aliases§
- Boxed
Function - Convenience alias for the boxed function trait object the host works with.
- Function_
CTO - A type alias for the const-constructible
Function_TO. - Host
Api_ CTO - A type alias for the const-constructible
HostApi_TO.