mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 14:51:15 +00:00
Add a trait to get the vtable for a type
This commit is contained in:
parent
4ca45ca4da
commit
b745c616f7
5 changed files with 72 additions and 13 deletions
|
@ -19,6 +19,16 @@ pub trait VTableMetaDrop: VTableMeta {
|
|||
unsafe fn drop(ptr: *mut Self::Target);
|
||||
}
|
||||
|
||||
/// Allow to associate a VTable to a type.
|
||||
pub unsafe trait HasStaticVTable<VT>
|
||||
where
|
||||
VT: ?Sized + VTableMeta,
|
||||
VT::VTable: 'static,
|
||||
{
|
||||
/// Savety: must be a valid VTable for Self
|
||||
const VTABLE: VT::VTable;
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
/// The inner structure of VRef, VRefMut, and VBox.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue