pub trait VTable<T> {
    fn build_vtable() -> Self;
}
Expand description

VTable defines a type that represents a virtual function table for some type T.

T is different than a type that can be turned into a trait object like Box<dyn Any> because a VTable effectively decouples the type’s behaviour from the data it contains.

This mechanism allows the virtual function table to be attached to a homogeneous container, to prevent storing duplicates of these tables for each type instance stored in the container.

This is precisely how it is used to build VecDyn<V>, which is generic over the virtual table rather than the type itself.

Required Methods

Implementations on Foreign Types

Implementors