[][src]Trait abi_stable::library::RootModule

pub trait RootModule: Sized + SharedStableAbi {
const BASE_NAME: &'static str;
const NAME: &'static str;
const VERSION_STRINGS: VersionStrings;
const LOADER_FN: &'static str;

    fn raw_library_ref() -> &'static LazyStaticRef<Library>;

    fn get_library_path(directory: &Path) -> PathBuf { ... }
fn load_from_library_in(
        directory: &Path
    ) -> Result<&'static Self, LibraryError> { ... }
fn load_from_library_at(
        full_path: &Path
    ) -> Result<&'static Self, LibraryError> { ... }
fn load_with(
        raw_library: &'static Library
    ) -> Result<&'static Self, LibraryError> { ... }
fn initialization(&'static self) -> Result<&'static Self, LibraryError> { ... } }

The root module of a dynamic library, which may contain other modules,function pointers,and static references.

For an example of a type implementing this trait you can look for the example/example_*_interface crates in this crates' repository .

Associated Constants

const BASE_NAME: &'static str

The base name of the dynamic library,which is the same on all platforms. This is generally the name of the implementation crate.

const NAME: &'static str

The name of the library used in error messages.

const VERSION_STRINGS: VersionStrings

The version number of this library.

Initialize this with package_version_strings!()

const LOADER_FN: &'static str

The name of the function which constructs this module.

The function signature for the loader is:

extern "C" fn()->WithLayout<Self>

Loading content...

Required methods

fn raw_library_ref() -> &'static LazyStaticRef<Library>

The late-initialized reference to the Library handle.

Loading content...

Provided methods

fn get_library_path(directory: &Path) -> PathBuf

Returns the path the library would be loaded from.

fn load_from_library_in(directory: &Path) -> Result<&'static Self, LibraryError>

Loads this module from the library in the directory directory, first loading the dynamic library from the directory if it wasn't already loaded.

fn load_from_library_at(full_path: &Path) -> Result<&'static Self, LibraryError>

Loads this module from the library at the full_path path, first loading the dynamic library from the directory if it wasn't already loaded.

fn load_with(
    raw_library: &'static Library
) -> Result<&'static Self, LibraryError>

Loads this module from the raw_library.

fn initialization(&'static self) -> Result<&'static Self, LibraryError>

Defines behavior that happens once the module is loaded.

Loading content...

Implementors

Loading content...