Expand description
The marshalling plan: the language-neutral calling contracts every backend renders, stated once.
The crate::model layer answers which symbols exist and what their C
signatures are. This module answers the questions one level up, the ones
the eleven generators used to answer independently (and inconsistently):
- Errors (
ErrorStrategy): when a call reports throughout_err, is that a typed domain error the caller can catch, or a producer bug the wrapper must trap on? - Ownership (
ReturnFree,ElemFree): after copying a returned value into a native one, exactly which runtime release call does the wrapper owe, if any? - Iterators (
IteratorProtocol): the pull contract ofiter<T>, including the requirement that wrappers stay lazy (one producernextper consumer step, never a hidden drain into a list). - Async (
AsyncProtocol): the completion-callback contract, including the rule that result buffers are borrowed for the callback’s duration and must be copied before it returns.
A backend that renders these plans in its own syntax cannot drift from the others on semantics; only the spelling differs.
Structs§
- Async
Protocol - The async completion contract every backend renders.
- Iterator
Protocol - The
iter<T>pull contract every backend renders.
Enums§
- Elem
Free - The release call a consumer wrapper owes for one element slot it copied
out of an array, a map buffer, or an iterator
nextslot. - Error
Strategy - How a callable’s
out_errslot is interpreted by idiomatic wrappers. - Return
Free - The release call(s) a consumer wrapper owes after copying a returned value into a native one.
Functions§
- elem_
free - The per-element release owed for one array/map/iterator element of type
ty, declared insidemoduleunderprefix. - return_
free - The release plan for a value of type
tyreturned from a callable declared insidemoduleunderprefix.None(a void return) owes nothing.