Struct emf_core_base_rs::module::native_module::NativeModule [−][src]
pub struct NativeModule<'a, O> { /* fields omitted */ }
A native module.
Implementations
impl<O> NativeModule<'_, O> where
O: AccessIdentifier,
[src]
impl<O> NativeModule<'_, O> where
O: AccessIdentifier,
[src]pub const unsafe fn new(
interface: NonNullConst<NativeModuleInterfaceFFI>
) -> Self
[src]
interface: NonNullConst<NativeModuleInterfaceFFI>
) -> Self
Construct a new instance from an interface.
Safety
This function allows the creation of invalid modules by bypassing lifetimes.
impl NativeModule<'_, Owned>
[src]
impl NativeModule<'_, Owned>
[src]pub const fn as_borrowed(&self) -> NativeModule<'_, BorrowImmutable<'_>>
[src]
Borrows the module interface.
pub fn as_borrowed_mut(&mut self) -> NativeModule<'_, BorrowMutable<'_>>
[src]
Borrows the module interface mutably.
impl<'a, O> NativeModule<'a, O> where
O: MutableAccessIdentifier,
[src]
impl<'a, O> NativeModule<'a, O> where
O: MutableAccessIdentifier,
[src]pub unsafe fn load<MO>(
&mut self,
module: &Module<'_, MO>,
interface: &impl CBaseInterfaceInfo
) -> Result<NativeModuleInstance<'a, Owned>, Error> where
MO: AccessIdentifier,
[src]
&mut self,
module: &Module<'_, MO>,
interface: &impl CBaseInterfaceInfo
) -> Result<NativeModuleInstance<'a, Owned>, Error> where
MO: AccessIdentifier,
Loads the module.
Failure
The function can fail if some module invariant is not met.
Return
Handle on success, error otherwise.
Safety
The function crosses the ffi boundary. Direct usage of a NativeModule may break some invariants of the module api, if not handled with care.
pub unsafe fn unload(
&mut self,
instance: NativeModuleInstance<'_, Owned>
) -> Result<(), Error>
[src]
&mut self,
instance: NativeModuleInstance<'_, Owned>
) -> Result<(), Error>
Unloads the module.
Failure
The function can fail if some module invariant is not met or instance
is invalid.
Return
Error on failure.
Safety
The function crosses the ffi boundary. Direct usage of a NativeModule may break some invariants of the module api, if not handled with care.
pub unsafe fn initialize(
&mut self,
instance: &mut NativeModuleInstance<'_, Owned>
) -> Result<(), Error>
[src]
&mut self,
instance: &mut NativeModuleInstance<'_, Owned>
) -> Result<(), Error>
Initializes the module.
Failure
The function can fail if some module invariant is not met or instance
is invalid.
Return
Error on failure.
Safety
The function crosses the ffi boundary. Direct usage of a NativeModule may break some invariants of the module api, if not handled with care.
pub unsafe fn terminate(
&mut self,
instance: &mut NativeModuleInstance<'_, Owned>
) -> Result<(), Error>
[src]
&mut self,
instance: &mut NativeModuleInstance<'_, Owned>
) -> Result<(), Error>
Terminates the module.
Failure
The function can fail if some module invariant is not met or instance
is invalid.
Return
Error on failure.
Safety
The function crosses the ffi boundary. Direct usage of a NativeModule may break some invariants of the module api, if not handled with care.
impl<'a, O> NativeModule<'a, O> where
O: ImmutableAccessIdentifier,
[src]
impl<'a, O> NativeModule<'a, O> where
O: ImmutableAccessIdentifier,
[src]pub unsafe fn get_interface<'instance, IO, T>(
&self,
instance: &'instance NativeModuleInstance<'instance, IO>,
interface: &InterfaceDescriptor,
caster: impl FnOnce(Interface) -> T
) -> Result<Interface<'instance, T>, Error> where
IO: ImmutableAccessIdentifier,
[src]
&self,
instance: &'instance NativeModuleInstance<'instance, IO>,
interface: &InterfaceDescriptor,
caster: impl FnOnce(Interface) -> T
) -> Result<Interface<'instance, T>, Error> where
IO: ImmutableAccessIdentifier,
Fetches an interface from the module.
Failure
The function fails if instance
is invalid.
Return
Interface on success, error otherwise.
Safety
The function is not thread-safe and crosses the ffi boundary. Direct usage of a NativeModule may break some invariants of the module api, if not handled with care.
pub unsafe fn get_module_info<'instance, IO>(
&self,
instance: &'instance NativeModuleInstance<'instance, IO>
) -> Result<&'instance ModuleInfo, Error> where
IO: ImmutableAccessIdentifier,
[src]
&self,
instance: &'instance NativeModuleInstance<'instance, IO>
) -> Result<&'instance ModuleInfo, Error> where
IO: ImmutableAccessIdentifier,
Fetches the module info of the module.
Failure
The function fails if instance
is invalid.
Return
Module info on success, error otherwise.
Safety
The function is not thread-safe and crosses the ffi boundary. Direct usage of a NativeModule may break some invariants of the module api, if not handled with care.
pub unsafe fn get_load_dependencies(&self) -> &'a [InterfaceDescriptor]
[src]
Fetches the load dependencies of the module.
Return
Load dependencies.
Safety
The function crosses the ffi boundary. Direct usage of a NativeModule may break some invariants of the module api, if not handled with care.
pub unsafe fn get_runtime_dependencies<'instance, IO>(
&self,
instance: &'instance NativeModuleInstance<'instance, IO>
) -> Result<&'instance [InterfaceDescriptor], Error> where
IO: ImmutableAccessIdentifier,
[src]
&self,
instance: &'instance NativeModuleInstance<'instance, IO>
) -> Result<&'instance [InterfaceDescriptor], Error> where
IO: ImmutableAccessIdentifier,
Fetches the runtime dependencies of the module.
Failure
The function fails if instance
is invalid.
Return
Runtime dependencies on success, error otherwise.
Safety
The function is not thread-safe and crosses the ffi boundary. Direct usage of a NativeModule may break some invariants of the module api, if not handled with care.
pub unsafe fn get_exportable_interfaces<'instance, IO>(
&self,
instance: &'instance NativeModuleInstance<'instance, IO>
) -> Result<&'instance [InterfaceDescriptor], Error> where
IO: ImmutableAccessIdentifier,
[src]
&self,
instance: &'instance NativeModuleInstance<'instance, IO>
) -> Result<&'instance [InterfaceDescriptor], Error> where
IO: ImmutableAccessIdentifier,
Fetches the exportable interfaces of the module.
Failure
The function fails if instance
is invalid.
Return
Exportable interfaces on success, error otherwise.
Safety
The function is not thread-safe and crosses the ffi boundary. Direct usage of a NativeModule may break some invariants of the module api, if not handled with care.
Methods from Deref<Target = NonNullConst<NativeModuleInterfaceFFI>>
pub unsafe fn into_mut(&self) -> NonNull<T>
[src]
Acquires a mutable version of the pointer.
Safety
It is undefined behavior if the underlying pointer is not already mutable.
pub unsafe fn as_ref(&self) -> &T
[src]
Trait Implementations
impl<'a, O: Clone> Clone for NativeModule<'a, O>
[src]
impl<'a, O: Clone> Clone for NativeModule<'a, O>
[src]fn clone(&self) -> NativeModule<'a, O>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a, O: Copy> Copy for NativeModule<'a, O>
[src]
impl<'a, O: Copy> Copy for NativeModule<'a, O>
[src]impl<'a, O: Debug> Debug for NativeModule<'a, O>
[src]
impl<'a, O: Debug> Debug for NativeModule<'a, O>
[src]impl<O> Deref for NativeModule<'_, O>
[src]
impl<O> Deref for NativeModule<'_, O>
[src]type Target = NonNullConst<NativeModuleInterfaceFFI>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl<'a, O: Eq> Eq for NativeModule<'a, O>
[src]
impl<'a, O: Eq> Eq for NativeModule<'a, O>
[src]impl<'a, O: Ord> Ord for NativeModule<'a, O>
[src]
impl<'a, O: Ord> Ord for NativeModule<'a, O>
[src]impl<'a, O: PartialEq> PartialEq<NativeModule<'a, O>> for NativeModule<'a, O>
[src]
impl<'a, O: PartialEq> PartialEq<NativeModule<'a, O>> for NativeModule<'a, O>
[src]fn eq(&self, other: &NativeModule<'a, O>) -> bool
[src]
fn ne(&self, other: &NativeModule<'a, O>) -> bool
[src]
impl<'a, O: PartialOrd> PartialOrd<NativeModule<'a, O>> for NativeModule<'a, O>
[src]
impl<'a, O: PartialOrd> PartialOrd<NativeModule<'a, O>> for NativeModule<'a, O>
[src]fn partial_cmp(&self, other: &NativeModule<'a, O>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<O> Send for NativeModule<'_, O>
[src]
impl<O> Send for NativeModule<'_, O>
[src]impl<'a, O> StructuralEq for NativeModule<'a, O>
[src]
impl<'a, O> StructuralEq for NativeModule<'a, O>
[src]impl<'a, O> StructuralPartialEq for NativeModule<'a, O>
[src]
impl<'a, O> StructuralPartialEq for NativeModule<'a, O>
[src]impl<O> Sync for NativeModule<'_, O>
[src]
impl<O> Sync for NativeModule<'_, O>
[src]Auto Trait Implementations
impl<'a, O> RefUnwindSafe for NativeModule<'a, O> where
O: RefUnwindSafe,
impl<'a, O> RefUnwindSafe for NativeModule<'a, O> where
O: RefUnwindSafe,
impl<'a, O> Unpin for NativeModule<'a, O>
impl<'a, O> Unpin for NativeModule<'a, O>
impl<'a, O> UnwindSafe for NativeModule<'a, O> where
O: RefUnwindSafe,
impl<'a, O> UnwindSafe for NativeModule<'a, O> where
O: RefUnwindSafe,