Struct Library

Source
pub struct Library { /* private fields */ }

Implementations§

Source§

impl Library

Source

pub fn this_program() -> Result<Self, CString>

Source

pub fn new(filename: &CStr, bind_lazy: bool) -> Result<Self, CString>

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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§

Source§

impl Debug for Library

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Library

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AssertSendSyncExt for T

Source§

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> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.