Struct DlsymWeak

pub(crate) struct DlsymWeak<F> { pub(in ::sys::pal::unix::weak::dlsym) name: *const c_char, pub(in ::sys::pal::unix::weak::dlsym) func: Atomic<*mut c_void>, pub(in ::sys::pal::unix::weak::dlsym) _marker: PhantomData<F> }

Fields

name: *const c_char

A pointer to the nul-terminated name of the symbol.

func: Atomic<*mut c_void>
_marker: PhantomData<F>

Implementations

impl<F: FnPtr> DlsymWeak<F>

const unsafe fn new(name: &'static CStr) -> Self

Safety

If the signature of F does not match the signature of the symbol (if it exists), calling the function pointer returned by get() is undefined behaviour.

fn get(&self) -> Option<F>
fn initialize(&self) -> Option<F>

Trait Implementations

impl<F> Send for DlsymWeak<F>

impl<F> Sync for DlsymWeak<F>

Auto Trait Implementations

impl<F> !Freeze for DlsymWeak<F>

impl<F> RefUnwindSafe for DlsymWeak<F> where PhantomData<F>: RefUnwindSafe,

impl<F> Unpin for DlsymWeak<F> where PhantomData<F>: Unpin,

impl<F> UnsafeUnpin for DlsymWeak<F> where PhantomData<F>: UnsafeUnpin,

impl<F> UnwindSafe for DlsymWeak<F> where PhantomData<F>: UnwindSafe,

Blanket Implementations

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

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for DlsymWeak<F> where T: ?Sized,

fn borrow(&self) -> &T

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

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

impl<T> From<T> for DlsymWeak<F>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> SizeHint for DlsymWeak<F> where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for DlsymWeak<F>

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

fn into(self) -> U

Calls U::from(self).

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

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

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

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

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