pub enum ExportEntry {
Native {
name: &'static str,
signature: fn() -> Result<(Vec<Expr>, Expr), String>,
},
Margs {
name: &'static str,
signature: fn() -> (Vec<Expr>, Expr),
},
Wstp {
name: &'static str,
},
Wxf {
name: &'static str,
signature: fn() -> Result<(Vec<Expr>, Expr), String>,
},
}Expand description
Inventory entry for one #[export]-marked function.
Replaces the legacy LibraryLinkFunction enum from wolfram-library-link.
All three export-mode runtimes (wolfram-export-native, wolfram-export-wstp,
wolfram-export-wxf) submit entries of this single shared type to one
global inventory; exported_library_functions_association iterates that
inventory regardless of mode.
Variants§
Native
Native MArgument-based export.
Fields
Margs
Raw MArgument-based export (#[export(margs)]). Argument/return types
are opaque to the macro by default (the user marshals
&[MArgument]/MArgument by hand) — unlike Native, whose signature
is inferred from FromArg/IntoArg impls, there’s nothing to infer
here. signature is never absent, though: the macro always
materializes one at expansion time — the user’s
#[export(margs, args = ..., ret = ...)] annotation if given, or
(with a compile-time warning) a default of the same fixed
LinkObject/LinkObject placeholder Wstp uses.
Fields
Wstp
WSTP LinkObject-based export.
Wxf
Typed-args WXF-based export (NEW). Wire shape is {ByteArray} -> ByteArray
at the LibraryLink level; the byte arrays carry WXF-encoded payloads of
the user-declared Rust types.