pub struct NativeLoaderInternal<'loader> { /* private fields */ }
Expand description
Native library loader internal interface.
Implementations§
Source§impl NativeLoaderInternal<'_>
impl NativeLoaderInternal<'_>
Sourcepub unsafe fn load_ext(
&mut self,
path: &impl AsRef<Path>,
flags: i32,
) -> Result<InternalLibrary<Owned>, Error>
pub unsafe fn load_ext( &mut self, path: &impl AsRef<Path>, flags: i32, ) -> Result<InternalLibrary<Owned>, Error>
Loads a library. The resulting handle is unique.
The argument flags
is passed to dlopen
.
§Failure
The function fails if path
is invalid or
the call to dlopen
fails.
§Return
Handle on success, error otherwise.
§Safety
The function crosses the ffi boundary. Direct usage of a NativeLoaderInternal may break some invariants of the library api, if not handled with care.
Sourcepub unsafe fn get_native_handle<O>(
&self,
internal: &InternalLibrary<O>,
) -> Result<NativeLibraryHandle, Error>where
O: ImmutableAccessIdentifier,
pub unsafe fn get_native_handle<O>(
&self,
internal: &InternalLibrary<O>,
) -> Result<NativeLibraryHandle, Error>where
O: ImmutableAccessIdentifier,
Returns the underlying handle of a library.
§Failure
The function fails if internal
is invalid.
§Return
Handle on success, error otherwise.
§Safety
The function crosses the ffi boundary. Direct usage of a NativeLoaderInternal may break some invariants of the library api, if not handled with care.
Methods from Deref<Target = NonNullConst<NativeLibraryLoaderInterface>>§
Trait Implementations§
Source§impl<'loader> Clone for NativeLoaderInternal<'loader>
impl<'loader> Clone for NativeLoaderInternal<'loader>
Source§fn clone(&self) -> NativeLoaderInternal<'loader>
fn clone(&self) -> NativeLoaderInternal<'loader>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'loader> Debug for NativeLoaderInternal<'loader>
impl<'loader> Debug for NativeLoaderInternal<'loader>
Source§impl Deref for NativeLoaderInternal<'_>
impl Deref for NativeLoaderInternal<'_>
Source§type Target = NonNullConst<NativeLibraryLoaderInterface>
type Target = NonNullConst<NativeLibraryLoaderInterface>
The resulting type after dereferencing.
Source§impl DerefMut for NativeLoaderInternal<'_>
impl DerefMut for NativeLoaderInternal<'_>
Source§impl<'a> LibraryLoaderAPI<'a> for NativeLoaderInternal<'a>
impl<'a> LibraryLoaderAPI<'a> for NativeLoaderInternal<'a>
Source§type InternalLoader = NativeLoaderInternal<'a>
type InternalLoader = NativeLoaderInternal<'a>
Type of the internal loader.
Source§fn to_interface(&self) -> NonNullConst<LibraryLoaderInterface>
fn to_interface(&self) -> NonNullConst<LibraryLoaderInterface>
Fetches a pointer that can be used with the interface.
Source§unsafe fn from_interface(
interface: NonNullConst<LibraryLoaderInterface>,
) -> Self
unsafe fn from_interface( interface: NonNullConst<LibraryLoaderInterface>, ) -> Self
Construct a new instance from a pointer. Read more
Source§unsafe fn from_void_ptr(interface: NonNullConst<c_void>) -> Self
unsafe fn from_void_ptr(interface: NonNullConst<c_void>) -> Self
Construct a new instance from a void pointer. Read more
Source§unsafe fn load(
&mut self,
path: &impl AsRef<Path>,
) -> Result<InternalLibrary<Owned>, Error>
unsafe fn load( &mut self, path: &impl AsRef<Path>, ) -> Result<InternalLibrary<Owned>, Error>
Loads a library. The resulting handle is unique. Read more
Source§unsafe fn unload(
&mut self,
internal: InternalLibrary<Owned>,
) -> Result<(), Error>
unsafe fn unload( &mut self, internal: InternalLibrary<Owned>, ) -> Result<(), Error>
Unloads a library. Read more
Source§unsafe fn get_data_symbol<O, U>(
&self,
internal: &InternalLibrary<O>,
symbol: &impl AsRef<CStr>,
caster: impl FnOnce(NonNullConst<c_void>) -> &'a U,
) -> Result<Symbol<'a, &'a U>, Error>where
O: ImmutableAccessIdentifier,
unsafe fn get_data_symbol<O, U>(
&self,
internal: &InternalLibrary<O>,
symbol: &impl AsRef<CStr>,
caster: impl FnOnce(NonNullConst<c_void>) -> &'a U,
) -> Result<Symbol<'a, &'a U>, Error>where
O: ImmutableAccessIdentifier,
Fetches a data symbol from a library. Read more
Source§unsafe fn get_function_symbol<O, U>(
&self,
internal: &InternalLibrary<O>,
symbol: &impl AsRef<CStr>,
caster: impl FnOnce(CBaseFn) -> U,
) -> Result<Symbol<'a, U>, Error>where
O: ImmutableAccessIdentifier,
unsafe fn get_function_symbol<O, U>(
&self,
internal: &InternalLibrary<O>,
symbol: &impl AsRef<CStr>,
caster: impl FnOnce(CBaseFn) -> U,
) -> Result<Symbol<'a, U>, Error>where
O: ImmutableAccessIdentifier,
Fetches a function symbol from a library. Read more
Source§unsafe fn get_internal_interface(&self) -> Self::InternalLoader
unsafe fn get_internal_interface(&self) -> Self::InternalLoader
Fetches a pointer to the internal interface. Read more
Source§impl<'loader> Ord for NativeLoaderInternal<'loader>
impl<'loader> Ord for NativeLoaderInternal<'loader>
Source§fn cmp(&self, other: &NativeLoaderInternal<'loader>) -> Ordering
fn cmp(&self, other: &NativeLoaderInternal<'loader>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'loader> PartialEq for NativeLoaderInternal<'loader>
impl<'loader> PartialEq for NativeLoaderInternal<'loader>
Source§fn eq(&self, other: &NativeLoaderInternal<'loader>) -> bool
fn eq(&self, other: &NativeLoaderInternal<'loader>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Source§impl<'loader> PartialOrd for NativeLoaderInternal<'loader>
impl<'loader> PartialOrd for NativeLoaderInternal<'loader>
impl<'loader> Copy for NativeLoaderInternal<'loader>
impl<'loader> Eq for NativeLoaderInternal<'loader>
impl Send for NativeLoaderInternal<'_>
impl<'loader> StructuralPartialEq for NativeLoaderInternal<'loader>
impl Sync for NativeLoaderInternal<'_>
Auto Trait Implementations§
impl<'loader> Freeze for NativeLoaderInternal<'loader>
impl<'loader> RefUnwindSafe for NativeLoaderInternal<'loader>
impl<'loader> Unpin for NativeLoaderInternal<'loader>
impl<'loader> UnwindSafe for NativeLoaderInternal<'loader>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more