2019-08-15 13:56:57 +09:00
|
|
|
pub struct VTable{
|
2020-09-01 17:28:11 -04:00
|
|
|
state:extern "C" fn(),
|
2019-08-15 13:56:57 +09:00
|
|
|
}
|
|
|
|
|
|
2024-03-22 14:55:26 +01:00
|
|
|
impl VTable {
|
2019-08-15 13:56:57 +09:00
|
|
|
pub const fn vtable()->&'static VTable{
|
|
|
|
|
Self::VTABLE
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const VTABLE: &'static VTable =
|
|
|
|
|
&VTable{state};
|
2024-03-22 14:55:26 +01:00
|
|
|
|
|
|
|
|
pub const VTABLE2: &'static VTable =
|
|
|
|
|
&VTable{state: state2};
|
2019-08-15 13:56:57 +09:00
|
|
|
}
|
|
|
|
|
|
2024-03-22 14:55:26 +01:00
|
|
|
pub const VTABLE3: &'static VTable =
|
|
|
|
|
&VTable{state: state3};
|
|
|
|
|
|
|
|
|
|
// Only referenced via a `pub const fn`, and yet reachable.
|
2020-09-01 17:28:11 -04:00
|
|
|
extern "C" fn state() {}
|
2024-03-22 14:55:26 +01:00
|
|
|
// Only referenced via a associated `pub const`, and yet reachable.
|
|
|
|
|
extern "C" fn state2() {}
|
|
|
|
|
// Only referenced via a free `pub const`, and yet reachable.
|
|
|
|
|
extern "C" fn state3() {}
|