Module emf_core_base_rs::global::module[][src]

Global module api.

Example

use emf_core_base_rs::global::{LockToken, Unlock, module, version};
use emf_core_base_rs::module::{DEFAULT_HANDLE, InterfaceDescriptor, InterfaceName};
use emf_core_base_rs::ffi::collections::ConstSpan;
use std::path::Path;

let mut lock = LockToken::<Unlock>::lock();

let module_path = Path::new("path to a module");
let interface_desc = InterfaceDescriptor {
    name: InterfaceName::from("my_interface"),
    version: version::new_short(1, 0, 0),
    extensions: ConstSpan::new()
};

let mut module = module::add_module(&DEFAULT_HANDLE, &module_path)?;
module::load(&mut module)?;
module::initialize(&mut module)?;
module::export_interface(&mut module, &interface_desc)?;

Functions

add_dependency

Registers a new runtime dependency of the module.

add_module

Adds a new module.

create_module_handle

Creates a new unlinked module handle.

export_interface

Exports an interface of a module.

exported_interface_exists

Checks whether an exported interface exists.

fetch_status

Fetches the load status of a module.

get_exportable_interfaces

Fetches the exportable interfaces of a module.

get_exported_interface_handle

Fetches the module handle of the exported interface.

get_exported_interfaces

Copies the descriptors of the exported interfaces into a buffer.

get_interface

Fetches an interface from a module.

get_internal_module_handle

Fetches the internal handle linked with the module handle.

get_load_dependencies

Fetches the load dependencies of a module.

get_loader_handle_from_module

Fetches the handle of the loader linked with the module handle.

get_loader_handle_from_type

Fetches the handle of the loader associated with a module type.

get_loader_interface

Fetches the interface of a module loader.

get_module_info

Fetches the module info from a module.

get_module_path

Fetches the path a module was loaded from.

get_module_types

Copies the available module types into a buffer.

get_modules

Copies the available module info into a buffer.

get_num_exported_interfaces

Fetches the number of exported interfaces.

get_num_loaders

Fetches the number of loaders.

get_num_modules

Fetches the number of loaded modules.

get_runtime_dependencies

Fetches the runtime dependencies of a module.

initialize

Initializes a module.

link_module

Links a module handle to an internal module handle.

load

Loads a module.

module_exists

Checks if a module exists.

register_loader

Registers a new module loader.

remove_dependency

Removes an existing runtime dependency from the module.

remove_module

Removes a module.

remove_module_handle

Links a module handle to an internal module handle.

terminate

Terminates a module.

type_exists

Checks if a module type exists.

unload

Unloads a module.

unregister_loader

Unregisters an existing module loader.