pub struct CScriptLibrary { /* private fields */ }Expand description
One loaded shared library’s three FFI entry points. Kept alive for as long as any
CScriptInstance built from it exists (each instance holds an Arc to this) — the
Library must outlive every raw function pointer taken from it.
Implementations§
Source§impl CScriptLibrary
impl CScriptLibrary
Sourcepub fn load(path: &Path) -> Result<Self, CScriptError>
pub fn load(path: &Path) -> Result<Self, CScriptError>
Loads path and resolves cscript_start (always required) plus every optional symbol
this crate knows about (cscript_output, cscript_derivative, cscript_output_xc,
cscript_update, cscript_free, cscript_clone, and the
cscript_state_size/cscript_state_write/cscript_state_read triple) — see the module
doc comment for what each one’s absence means. Which combination is actually required
for a given instantiation is checked separately, by
CScriptRegistry::instantiate/CScriptRegistry::instantiate_xc — except the state
triple, which is all-or-nothing and checked here: exporting one or two of the three is
CScriptError::MissingSymbol naming the first absent one.