[−][src]Struct beryllium::CDyLib
Handle to a C ABI dynamic library that has been loaded.
You can make your own libs that will work with this using the cdylib
crate
type
(here
is a short tutorial).
Do not attempt to mix this with the dylib
crate type. That's a crate type
you should not use, it's basically for rustc
internal usage only.
Methods
impl<'sdl> CDyLib<'sdl>
[src]
pub unsafe fn find_function(&self, name: &str) -> Option<NonNull<c_void>>
[src]
Attempts to look up a function by name, getting its pointer.
Once this function returns, you will have to
transmute the optional NonNull value you get into
an optional fn
value of some sort.
You probably want to transmute it into Option<unsafe extern "C" fn(INPUTS) -> OUTPUTS>
, but it's possible that you might need to use some
other ABI for example. This whole thing is obviously not at all safe. You
absolutely must get the fn
type correct when doing this transmute
.
Safety
- The returned value does not have a lifetime linking it back to this shared library. Making sure that the function pointer is not used after this library unloads is up to you.
Trait Implementations
Auto Trait Implementations
impl<'sdl> Unpin for CDyLib<'sdl>
impl<'sdl> !Sync for CDyLib<'sdl>
impl<'sdl> !Send for CDyLib<'sdl>
impl<'sdl> UnwindSafe for CDyLib<'sdl>
impl<'sdl> RefUnwindSafe for CDyLib<'sdl>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,