Struct dlfcn::dynlib::Library
[−]
[src]
pub struct Library { /* fields omitted */ }
A handle wrapper with a VTable of symbols found in the library as they're requested.
Methods
impl Library
[src]
pub unsafe fn handle(&self) -> &*mut c_void
[src]
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.
pub unsafe fn table(&self) -> &HashMap<String, *mut c_void>
[src]
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.
pub fn name(&self) -> String
[src]
Returns the path of the dynamic library as given to [open
] or [new
].
pub fn sym<T>(&mut self, name: String) -> Option<Box<T>>
[src]
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
].
pub fn open(name: String, flags: RtldValue, closure: fn(lib: Library)) -> bool
[src]
Makes a safe instance using [new
] then applies the closure given to it.
It returns true if it was successful, or false if anything went wrong.
pub unsafe fn new(name_c: CString, flags: RtldValue) -> Option<Self>
[src]
Creates a new instance of the library wanted. There are no checks other than handle checks upon loading it. It is the user's responsibility to pass a valid CString instance and valid flags.