Struct emf_core_base_rs::library::library_loader::LibraryLoader [−][src]
pub struct LibraryLoader<T, O> { /* fields omitted */ }
A library loader.
Implementations
impl<'a, T, O> LibraryLoader<T, O> where
T: LibraryLoaderAPI<'a>,
O: AccessIdentifier,
[src]
impl<'a, T, O> LibraryLoader<T, O> where
T: LibraryLoaderAPI<'a>,
O: AccessIdentifier,
[src]pub fn to_interface(&self) -> NonNullConst<LibraryLoaderInterface>
[src]
Fetches a pointer that can be used with the interface.
pub unsafe fn from_interface(
handler: NonNullConst<LibraryLoaderInterface>
) -> Self
[src]
handler: NonNullConst<LibraryLoaderInterface>
) -> Self
pub unsafe fn from_void_ptr(handler: NonNullConst<c_void>) -> Self
[src]
impl<'a, T, O> LibraryLoader<T, O> where
T: LibraryLoaderAPI<'a>,
O: MutableAccessIdentifier,
[src]
impl<'a, T, O> LibraryLoader<T, O> where
T: LibraryLoaderAPI<'a>,
O: MutableAccessIdentifier,
[src]pub unsafe fn load(
&mut self,
path: &impl AsRef<Path>
) -> Result<InternalLibrary<Owned>, Error>
[src]
&mut self,
path: &impl AsRef<Path>
) -> Result<InternalLibrary<Owned>, Error>
Loads a library. The resulting handle is unique.
Failure
The function fails if loader
or path
is invalid or
the type of the library can not be loaded with the loader.
Return
Handle on success, error otherwise.
Safety
The function crosses the ffi boundary. Direct usage of a LibraryLoader may break some invariants of the library api, if not handled with care.
pub unsafe fn unload(
&mut self,
internal: InternalLibrary<Owned>
) -> Result<(), Error>
[src]
&mut self,
internal: InternalLibrary<Owned>
) -> Result<(), Error>
Unloads a library.
Failure
The function fails if internal
is invalid.
Return
Error on failure.
Safety
The function crosses the ffi boundary. Direct usage of a LibraryLoader may break some invariants of the library api, if not handled with care.
impl<'a, T, O> LibraryLoader<T, O> where
T: LibraryLoaderAPI<'a>,
O: ImmutableAccessIdentifier,
[src]
impl<'a, T, O> LibraryLoader<T, O> where
T: LibraryLoaderAPI<'a>,
O: ImmutableAccessIdentifier,
[src]pub unsafe fn get_data_symbol<LO, U>(
&self,
internal: &InternalLibrary<LO>,
symbol: &impl AsRef<CStr>,
caster: impl FnOnce(NonNullConst<c_void>) -> &'a U
) -> Result<Symbol<'a, &'a U>, Error> where
LO: ImmutableAccessIdentifier,
[src]
&self,
internal: &InternalLibrary<LO>,
symbol: &impl AsRef<CStr>,
caster: impl FnOnce(NonNullConst<c_void>) -> &'a U
) -> Result<Symbol<'a, &'a U>, Error> where
LO: ImmutableAccessIdentifier,
Fetches a data symbol from a library.
Failure
The function fails if internal
is invalid or library does not contain symbol
.
Note
Some platforms may differentiate between a function-pointer
and a data-pointer
.
See LibraryLoader::get_function_symbol() for fetching a function.
Return
Symbol on success, error otherwise.
Safety
The function crosses the ffi boundary. Direct usage of a LibraryLoader may break some invariants of the library api, if not handled with care.
pub unsafe fn get_function_symbol<LO, U>(
&self,
internal: &InternalLibrary<LO>,
symbol: &impl AsRef<CStr>,
caster: impl FnOnce(CBaseFn) -> U
) -> Result<Symbol<'a, U>, Error> where
LO: ImmutableAccessIdentifier,
[src]
&self,
internal: &InternalLibrary<LO>,
symbol: &impl AsRef<CStr>,
caster: impl FnOnce(CBaseFn) -> U
) -> Result<Symbol<'a, U>, Error> where
LO: ImmutableAccessIdentifier,
Fetches a function symbol from a library.
Failure
The function fails if internal
is invalid or library does not contain symbol
.
Note
Some platforms may differentiate between a function-pointer
and a data-pointer
.
See LibraryLoader::get_data_symbol() for fetching some data.
Return
Symbol on success, error otherwise.
Safety
The function crosses the ffi boundary. Direct usage of a LibraryLoader may break some invariants of the library api, if not handled with care.
pub unsafe fn get_internal_interface(
&self
) -> LibraryLoader<T::InternalLoader, O>
[src]
&self
) -> LibraryLoader<T::InternalLoader, O>
Fetches a pointer to the internal interface.
Return
Pointer to the interface.
Safety
The function crosses the ffi boundary. Direct usage of a LibraryLoader may break some invariants of the library api, if not handled with care.
Trait Implementations
impl<T: Clone, O: Clone> Clone for LibraryLoader<T, O>
[src]
impl<T: Clone, O: Clone> Clone for LibraryLoader<T, O>
[src]fn clone(&self) -> LibraryLoader<T, O>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Copy, O: Copy> Copy for LibraryLoader<T, O>
[src]
impl<T: Copy, O: Copy> Copy for LibraryLoader<T, O>
[src]impl<T: Debug, O: Debug> Debug for LibraryLoader<T, O>
[src]
impl<T: Debug, O: Debug> Debug for LibraryLoader<T, O>
[src]impl<'a, T, O> Deref for LibraryLoader<T, O> where
T: LibraryLoaderAPI<'a>,
O: AccessIdentifier,
[src]
impl<'a, T, O> Deref for LibraryLoader<T, O> where
T: LibraryLoaderAPI<'a>,
O: AccessIdentifier,
[src]impl<'a, T, O> DerefMut for LibraryLoader<T, O> where
T: LibraryLoaderAPI<'a>,
O: MutableAccessIdentifier,
[src]
impl<'a, T, O> DerefMut for LibraryLoader<T, O> where
T: LibraryLoaderAPI<'a>,
O: MutableAccessIdentifier,
[src]impl<T: Eq, O: Eq> Eq for LibraryLoader<T, O>
[src]
impl<T: Eq, O: Eq> Eq for LibraryLoader<T, O>
[src]impl<T: Ord, O: Ord> Ord for LibraryLoader<T, O>
[src]
impl<T: Ord, O: Ord> Ord for LibraryLoader<T, O>
[src]impl<T: PartialEq, O: PartialEq> PartialEq<LibraryLoader<T, O>> for LibraryLoader<T, O>
[src]
impl<T: PartialEq, O: PartialEq> PartialEq<LibraryLoader<T, O>> for LibraryLoader<T, O>
[src]fn eq(&self, other: &LibraryLoader<T, O>) -> bool
[src]
fn ne(&self, other: &LibraryLoader<T, O>) -> bool
[src]
impl<T: PartialOrd, O: PartialOrd> PartialOrd<LibraryLoader<T, O>> for LibraryLoader<T, O>
[src]
impl<T: PartialOrd, O: PartialOrd> PartialOrd<LibraryLoader<T, O>> for LibraryLoader<T, O>
[src]fn partial_cmp(&self, other: &LibraryLoader<T, 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<T, O> StructuralEq for LibraryLoader<T, O>
[src]
impl<T, O> StructuralEq for LibraryLoader<T, O>
[src]impl<T, O> StructuralPartialEq for LibraryLoader<T, O>
[src]
impl<T, O> StructuralPartialEq for LibraryLoader<T, O>
[src]Auto Trait Implementations
impl<T, O> RefUnwindSafe for LibraryLoader<T, O> where
O: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, O> RefUnwindSafe for LibraryLoader<T, O> where
O: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, O> !Send for LibraryLoader<T, O>
impl<T, O> !Send for LibraryLoader<T, O>
impl<T, O> !Sync for LibraryLoader<T, O>
impl<T, O> !Sync for LibraryLoader<T, O>
impl<T, O> Unpin for LibraryLoader<T, O> where
T: Unpin,
impl<T, O> Unpin for LibraryLoader<T, O> where
T: Unpin,
impl<T, O> UnwindSafe for LibraryLoader<T, O> where
O: RefUnwindSafe,
T: UnwindSafe,
impl<T, O> UnwindSafe for LibraryLoader<T, O> where
O: RefUnwindSafe,
T: UnwindSafe,