pub struct Library { /* private fields */ }
Implementations§
Source§impl Library
impl Library
pub fn this_program() -> Result<Self, CString>
pub fn new(filename: &CStr, bind_lazy: bool) -> Result<Self, CString>
Sourcepub fn sym_var<'a, T>(
&'a self,
symbol: &CStr,
) -> Result<LibraryVar<'a, T>, LibraryError>
pub fn sym_var<'a, T>( &'a self, symbol: &CStr, ) -> Result<LibraryVar<'a, T>, LibraryError>
Returns Ok(None) if symbol
’s value is NULL. Returns Err(msg)
if dlsym failed with error msg
.
Sourcepub fn sym_func<'a, F: FnPtr>(
&'a self,
symbol: &CStr,
) -> Result<LibraryFunc<'a, F>, LibraryError>
pub fn sym_func<'a, F: FnPtr>( &'a self, symbol: &CStr, ) -> Result<LibraryFunc<'a, F>, LibraryError>
F must be a function pointer type
Returns Ok(None) if symbol
’s value is NULL. Returns Err(msg)
if dlsym failed with error msg
.
Sourcepub unsafe fn sym_func_unchecked<'a, F>(
&'a self,
symbol: &CStr,
) -> Result<LibraryFunc<'a, F>, LibraryError>
pub unsafe fn sym_func_unchecked<'a, F>( &'a self, symbol: &CStr, ) -> Result<LibraryFunc<'a, F>, LibraryError>
F must be a function pointer type
Returns Ok(None) if symbol
’s value is NULL. Returns Err(msg)
if dlsym failed with error msg
.
Sourcepub fn sym_var_owned<T>(
self: &Arc<Self>,
symbol: &CStr,
) -> Result<OwnedLibraryVar<T>, LibraryError>
pub fn sym_var_owned<T>( self: &Arc<Self>, symbol: &CStr, ) -> Result<OwnedLibraryVar<T>, LibraryError>
Returns Ok(None) if symbol
’s value is NULL. Returns Err(msg)
if dlsym failed with error msg
.
Sourcepub fn sym_func_owned<F: FnPtr>(
self: &Arc<Self>,
symbol: &CStr,
) -> Result<OwnedLibraryFunc<F>, LibraryError>
pub fn sym_func_owned<F: FnPtr>( self: &Arc<Self>, symbol: &CStr, ) -> Result<OwnedLibraryFunc<F>, LibraryError>
F must be a function pointer type
Returns Ok(None) if symbol
’s value is NULL. Returns Err(msg)
if dlsym failed with error msg
.
Sourcepub unsafe fn sym_func_owned_unchecked<F>(
self: &Arc<Self>,
symbol: &CStr,
) -> Result<OwnedLibraryFunc<F>, LibraryError>
pub unsafe fn sym_func_owned_unchecked<F>( self: &Arc<Self>, symbol: &CStr, ) -> Result<OwnedLibraryFunc<F>, LibraryError>
F must be a function pointer type.
Returns Ok(None) if symbol
’s value is NULL. Returns Err(msg)
if dlsym failed with error msg
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Library
impl RefUnwindSafe for Library
impl !Send for Library
impl !Sync for Library
impl Unpin for Library
impl UnwindSafe for Library
Blanket Implementations§
Source§impl<T> AssertSendSyncExt for T
impl<T> AssertSendSyncExt for T
Source§unsafe fn assert_send_sync(self) -> AssertSendSync<Self>
unsafe fn assert_send_sync(self) -> AssertSendSync<Self>
Asserts that this variable/function can be concurrently accessed from
different threads, and sent between threads.
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