1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use crate::ffi::{CBaseFn, FnId};
pub trait FnCaster {
type Type;
const ID: FnId;
fn cast(&self, func: CBaseFn) -> Self::Type;
}
macro_rules! transmute_caster {
($caster:ty, $target_fn:ty, $target_id:expr) => {
impl FnCaster for $caster {
type Type = $target_fn;
const ID: FnId = $target_id;
#[inline]
fn cast(&self, func: CBaseFn) -> Self::Type {
unsafe { std::mem::transmute(func) }
}
}
};
}
pub mod library;
pub mod module;
pub mod sys;
pub mod version;
#[cfg(feature = "extensions")]
pub mod extensions;