Expand description
Generic dlopen loading.
§No type erasure here
T is the host’s own #[repr(C)] entry struct (for bmux, that is
BmuxPluginV1). load() returns a *const T — a thin pointer, not a dyn Trait
— so there is no “convert a fat pointer between two different vtables” UB.
This crate neither knows nor needs to know which fields T has; it only reads
the symbol address and casts it to *const T. Reading those fields safely is the
host contract crate’s job.
§What the caller has to guarantee
Tand the struct the plugin actually exports have the same layout (backed by the host’sabi_versionfield);- every read of a field of
Tis wrapped incrate::panic::guard.
Structs§
- Loaded
Plugin - A loaded plugin.
Functions§
- find_
library - Finds a cdylib in a directory by walking the candidate list, returning the first one that exists.
- find_
library_ for_ target find_library, for a specific target triple.- lib_
ext_ for_ target - The cdylib extension implied by a target triple.
- library_
candidates - The cdylib file name candidates for this build’s target, in priority order.
- library_
candidates_ for_ target - The cdylib file name candidates for
target, in priority order. - open⚠
- Opens a cdylib and calls its entry function.