[][src]Struct sixtyfps_corelib::component::ComponentVTable

#[repr(C)]pub struct ComponentVTable {
    pub visit_children_item: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, index: isize, order: TraversalOrder, visitor: VRefMut<'_, ItemVisitorVTable>) -> VisitChildrenResult,
    pub get_item_ref: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, index: usize) -> Pin<VRef<'_, ItemVTable>>,
    pub layout_info: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>) -> LayoutInfo,
    pub apply_layout: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, _: Rect),
    pub drop_in_place: unsafe extern "C" fn(_: VRefMut<'_, ComponentVTable>) -> Layout,
    pub dealloc: unsafe extern "C" fn(_: &ComponentVTable, ptr: *mut u8, layout: Layout),
}

A Component is representing an unit that is allocated together

Fields

visit_children_item: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, index: isize, order: TraversalOrder, visitor: VRefMut<'_, ItemVisitorVTable>) -> VisitChildrenResult

Visit the children of the item at index index. Note that the root item is at index 0, so passing 0 would visit the item under root (the children of root). If you want to visit the root item, you need to pass -1 as an index.

get_item_ref: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, index: usize) -> Pin<VRef<'_, ItemVTable>>

Return a reference to an item using the given index

layout_info: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>) -> LayoutInfo

Returns the layout info for this component

apply_layout: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, _: Rect)

Apply the layout to all the items in the component, and set the geometry of the root to the given rect

drop_in_place: unsafe extern "C" fn(_: VRefMut<'_, ComponentVTable>) -> Layout

in-place destructor (for VRc)

dealloc: unsafe extern "C" fn(_: &ComponentVTable, ptr: *mut u8, layout: Layout)

dealloc function (for VRc)

Implementations

impl ComponentVTable[src]

pub fn new<T: Component>() -> Self[src]

Create a vtable suitable for a given type implementing the trait.

Trait Implementations

impl VTableMeta for ComponentVTable[src]

type VTable = ComponentVTable

That's the VTable itself (so most likely Self)

type Target = ComponentTO

That's the trait object that implements the functions Read more

impl VTableMetaDropInPlace for ComponentVTable[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.