Struct libloading::os::unix::Library [] [src]

pub struct Library { /* fields omitted */ }

A platform-specific equivalent of the cross-platform Library.

Methods

impl Library
[src]

Find and load a shared library (module).

Locations where library is searched for is platform specific and can’t be adjusted portably.

Corresponds to dlopen(filename, RTLD_NOW).

Load the dynamic libraries linked into main program.

This allows retrieving symbols from any dynamic library linked into the program, without specifying the exact library.

Corresponds to dlopen(NULL, RTLD_NOW).

Find and load a shared library (module).

Locations where library is searched for is platform specific and can’t be adjusted portably.

If the filename is None, null pointer is passed to dlopen.

Corresponds to dlopen(filename, flags).

Get a pointer to function or static variable by symbol name.

The symbol may not contain any null bytes, with an exception of last byte. A null terminated symbol may avoid a string allocation in some cases.

Symbol is interpreted as-is; no mangling is done. This means that symbols like x::y are most likely invalid.

Unsafety

Pointer to a value of arbitrary type is returned. Using a value with wrong type is undefined.

Platform-specific behaviour

OS X uses some sort of lazy initialization scheme, which makes loading TLS variables impossible. Using a TLS variable loaded this way on OS X is undefined behaviour.

Trait Implementations

impl Send for Library
[src]

impl Sync for Library
[src]

impl Drop for Library
[src]

A method called when the value goes out of scope. Read more

impl Debug for Library
[src]

Formats the value using the given formatter.

impl From<Library> for Library
[src]

Performs the conversion.