pub struct PluginKeepalive { /* private fields */ }Expand description
Owns the loaded Library handles so the cdylibs stay mapped for as long as
any registered tool/handler (whose fn pointers live inside the cdylib) may be
called. Shared via Arc: every PluginToolAdapter
(and, in B3, the ExtensionEmitter) holds a clone,
so the libraries unload only when the last holder drops — which is never
before the harness’s tool vec (and thus the last possible tool call) drops.
libloading::Library is Send + Sync (a handle/HMODULE), so the keepalive is
too — required because AgentTool: Send + Sync and the adapter carries it.
Implementations§
Source§impl PluginKeepalive
impl PluginKeepalive
Auto Trait Implementations§
impl !RefUnwindSafe for PluginKeepalive
impl !UnwindSafe for PluginKeepalive
impl Freeze for PluginKeepalive
impl Send for PluginKeepalive
impl Sync for PluginKeepalive
impl Unpin for PluginKeepalive
impl UnsafeUnpin for PluginKeepalive
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more