Struct libloading::Symbol
[−]
[src]
pub struct Symbol<'lib, T: 'lib> { // some fields omitted }
Symbol from a library.
This type is a safeguard against using dynamically loaded symbols after a Library
is
unloaded. Primary method to create an instance of a Symbol
is via Library::get
.
Due to implementation of the Deref
trait, an instance of Symbol
may be used as if it was a
function or variable directly, without taking care to “extract” function or variable manually
most of the time.
Examples
let sin: Symbol<unsafe extern fn(f64) -> f64> = unsafe { lib.get(b"sin\0").unwrap() }; let sine0 = unsafe { sin(0f64) }; assert!(sine0 < 0.1E-10);