pub struct DynLib { /* private fields */ }Implementations§
Source§impl DynLib
impl DynLib
Sourcepub unsafe fn load(path: &Path) -> Result<Self>
pub unsafe fn load(path: &Path) -> Result<Self>
Load a dynamic library from the given path.
§Safety
The target file must be a valid dynamic library for the current process.
Sourcepub fn from_library(library: Library, path: impl Into<PathBuf>) -> Self
pub fn from_library(library: Library, path: impl Into<PathBuf>) -> Self
Wrap an already-loaded libloading::Library.
Useful when the library was loaded elsewhere (e.g. by the OS or another loader) and only reference-counting ownership is needed here.
Sourcepub fn unowned() -> Self
pub fn unowned() -> Self
A handle that does NOT own the library (no unload on drop).
For refs obtained from plugins whose library lifetime is managed
externally (e.g. statically linked, or kept alive by another handle).
Uses dlopen(NULL) — a handle to the current process, which never
fails and whose “unload” is a no-op.
pub fn path(&self) -> &Path
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DynLib
impl RefUnwindSafe for DynLib
impl Send for DynLib
impl Sync for DynLib
impl Unpin for DynLib
impl UnsafeUnpin for DynLib
impl UnwindSafe for DynLib
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