Trait emf_core_base_rs_ffi::module::module_loader::ModuleLoaderBinding[][src]

pub trait ModuleLoaderBinding {
Show methods unsafe fn add_module(
        &mut self,
        path: NonNullConst<OSPathChar>
    ) -> Result<InternalHandle, Error>;
unsafe fn remove_module(
        &mut self,
        handle: InternalHandle
    ) -> Result<i8, Error>;
unsafe fn load(&mut self, handle: InternalHandle) -> Result<i8, Error>;
unsafe fn unload(&mut self, handle: InternalHandle) -> Result<i8, Error>;
unsafe fn initialize(&mut self, handle: InternalHandle) -> Result<i8, Error>;
unsafe fn terminate(&mut self, handle: InternalHandle) -> Result<i8, Error>;
unsafe fn fetch_status(
        &self,
        handle: InternalHandle
    ) -> Result<ModuleStatus, Error>;
unsafe fn get_interface(
        &self,
        handle: InternalHandle,
        interface: NonNullConst<InterfaceDescriptor>
    ) -> Result<Interface, Error>;
unsafe fn get_module_info(
        &self,
        handle: InternalHandle
    ) -> Result<NonNullConst<ModuleInfo>, Error>;
unsafe fn get_module_path(
        &self,
        handle: InternalHandle
    ) -> Result<NonNullConst<OSPathChar>, Error>;
unsafe fn get_load_dependencies(
        &self,
        handle: InternalHandle
    ) -> Result<ConstSpan<InterfaceDescriptor>, Error>;
unsafe fn get_runtime_dependencies(
        &self,
        handle: InternalHandle
    ) -> Result<ConstSpan<InterfaceDescriptor>, Error>;
unsafe fn get_exportable_interfaces(
        &self,
        handle: InternalHandle
    ) -> Result<ConstSpan<InterfaceDescriptor>, Error>;
unsafe fn get_internal_interface(&self) -> NonNullConst<c_void>;
}

Helper trait for using a module loader.

Required methods

unsafe fn add_module(
    &mut self,
    path: NonNullConst<OSPathChar>
) -> Result<InternalHandle, Error>
[src]

Adds a new module.

Failure

Fails if path is invalid or the type of the module can not be loaded with the loader.

Return

Module handle on success, error otherwise.

Safety

The function crosses the ffi boundary. Direct usage of a ModuleLoaderBinding may break some invariants of the module api, if not handled with care.

unsafe fn remove_module(&mut self, handle: InternalHandle) -> Result<i8, Error>[src]

Removes a module.

Failure

Fails if handle is invalid or the module is not in an unloaded state.

Return

Error on failure.

Safety

The function crosses the ffi boundary. Direct usage of a ModuleLoaderBinding may break some invariants of the module api, if not handled with care.

unsafe fn load(&mut self, handle: InternalHandle) -> Result<i8, Error>[src]

Loads a module.

Failure

Fails if handle is invalid, the load dependencies of the module are not exported or the module is not in an unloaded state.

Return

Error on failure.

Safety

The function crosses the ffi boundary. Direct usage of a ModuleLoaderBinding may break some invariants of the module api, if not handled with care.

unsafe fn unload(&mut self, handle: InternalHandle) -> Result<i8, Error>[src]

Unloads a module.

Failure

Fails if handle is invalid or the module is in an unloaded or ready state.

Return

Error on failure.

Safety

The function crosses the ffi boundary. Direct usage of a ModuleLoaderBinding may break some invariants of the module api, if not handled with care.

unsafe fn initialize(&mut self, handle: InternalHandle) -> Result<i8, Error>[src]

Initializes a module.

Failure

Fails if handle is invalid, the runtime dependencies of the module are not exported or the module is not in a loaded state.

Return

Error on failure.

Safety

The function crosses the ffi boundary. Direct usage of a ModuleLoaderBinding may break some invariants of the module api, if not handled with care.

unsafe fn terminate(&mut self, handle: InternalHandle) -> Result<i8, Error>[src]

Terminates a module.

Failure

Fails if handle is invalid or the module is not in a ready state.

Return

Error on failure.

Safety

The function crosses the ffi boundary. Direct usage of a ModuleLoaderBinding may break some invariants of the module api, if not handled with care.

unsafe fn fetch_status(
    &self,
    handle: InternalHandle
) -> Result<ModuleStatus, Error>
[src]

Fetches the load status of a module.

Failure

Fails if handle is invalid.

Return

Module status on success, error otherwise.

Safety

The function crosses the ffi boundary. Direct usage of a ModuleLoaderBinding may break some invariants of the module api, if not handled with care.

unsafe fn get_interface(
    &self,
    handle: InternalHandle,
    interface: NonNullConst<InterfaceDescriptor>
) -> Result<Interface, Error>
[src]

Fetches an interface from a module.

Failure

Fails if handle is invalid, the module is not in a ready state or the interface is not contained in the module.

Return

Interface on success, error otherwise.

Safety

The function crosses the ffi boundary. Direct usage of a ModuleLoaderBinding may break some invariants of the module api, if not handled with care.

unsafe fn get_module_info(
    &self,
    handle: InternalHandle
) -> Result<NonNullConst<ModuleInfo>, Error>
[src]

Fetches the module info from a module.

Failure

Fails if handle is invalid or the module is not yet loaded.

Return

Module info on success, error otherwise.

Safety

The function crosses the ffi boundary. Direct usage of a ModuleLoaderBinding may break some invariants of the module api, if not handled with care.

unsafe fn get_module_path(
    &self,
    handle: InternalHandle
) -> Result<NonNullConst<OSPathChar>, Error>
[src]

Fetches the path a module was loaded from.

Failure

Fails if handle is invalid or the module is not yet loaded.

Return

Module path on success, error otherwise.

Safety

The function crosses the ffi boundary. Direct usage of a ModuleLoaderBinding may break some invariants of the module api, if not handled with care.

unsafe fn get_load_dependencies(
    &self,
    handle: InternalHandle
) -> Result<ConstSpan<InterfaceDescriptor>, Error>
[src]

Fetches the load dependencies of a module.

Failure

Fails if handle is invalid.

Return

Load dependencies on success, error otherwise.

Safety

The function crosses the ffi boundary. Direct usage of a ModuleLoaderBinding may break some invariants of the module api, if not handled with care.

unsafe fn get_runtime_dependencies(
    &self,
    handle: InternalHandle
) -> Result<ConstSpan<InterfaceDescriptor>, Error>
[src]

Fetches the runtime dependencies of a module.

Failure

Fails if handle is invalid or the module is not yet loaded.

Return

Runtime dependencies on success, error otherwise.

Safety

The function crosses the ffi boundary. Direct usage of a ModuleLoaderBinding may break some invariants of the module api, if not handled with care.

unsafe fn get_exportable_interfaces(
    &self,
    handle: InternalHandle
) -> Result<ConstSpan<InterfaceDescriptor>, Error>
[src]

Fetches the exportable interfaces of a module.

Failure

Fails if handle is invalid or the module is not yet loaded.

Return

Exportable interfaces on success, error otherwise.

Safety

The function crosses the ffi boundary. Direct usage of a ModuleLoaderBinding may break some invariants of the module api, if not handled with care.

unsafe fn get_internal_interface(&self) -> NonNullConst<c_void>[src]

Fetches a pointer to the internal loader interface.

Return

Pointer to the loader interface.

Safety

The function crosses the ffi boundary. Direct usage of a ModuleLoaderBinding may break some invariants of the module api, if not handled with care.

Loading content...

Implementors

impl ModuleLoaderBinding for ModuleLoaderInterface[src]

impl ModuleLoaderBinding for NativeModuleLoaderInterface[src]

Loading content...