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<extern fn(f64) -> f64> = unsafe {
    lib.get(b"sin\0").unwrap()
};
let sine0 = sin(0);
assert!(sine0 < 0.1E-10);

Trait Implementations

impl<'lib, T> Deref for Symbol<'lib, T>
[src]

type Target = T

The resulting type after dereferencing

fn deref(&self) -> &T

The method called to dereference a value