pub struct Library { /* private fields */ }
Expand description
A handle wrapper with a VTable of symbols found in the library as they’re requested.
Implementations§
Source§impl Library
impl Library
Sourcepub unsafe fn handle(&self) -> &*mut c_void
pub unsafe fn handle(&self) -> &*mut c_void
Returns an unsafe reference to the handle of the library.
Usually, the [sym
] and drop
methods are enough, but you’re free to use it for
anything else, provided you can dereference it.
Sourcepub unsafe fn table(&self) -> &HashMap<String, *mut c_void>
pub unsafe fn table(&self) -> &HashMap<String, *mut c_void>
Returns an unsafe reference to the VTable of the library.
Usually, the [sym
] method is enough, though you’re free to use it for what you may want
to use it for.
Sourcepub fn name(&self) -> String
pub fn name(&self) -> String
Returns the path of the dynamic library as given to [open
] or [new
].
Sourcepub fn sym<T>(&mut self, name: String) -> Option<Box<T>>
pub fn sym<T>(&mut self, name: String) -> Option<Box<T>>
Requests and finds a symbol in the library.
So long [RtldOr::Local
] wasn’t specified, it will also look at other loaded symbols which
are either in the program itself or were loaded with [RtldOr::Global
].
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Library
impl RefUnwindSafe for Library
impl !Send for Library
impl !Sync for Library
impl Unpin for Library
impl UnwindSafe for Library
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