Function detrojt::get_ty_const_key [] [src]

pub fn get_ty_const_key<D: TyConst<T>, T: ?Sized + 'static>() -> usize

Get the key associated with TyConst<T> for D. Instantiations of this function determine what goes into the type constant table for D.

The key can be used to retrieve the data D via get_ty_const even if T is not statically known.

Implementation details

This returns the memory offset of the vtable associated with T relative to some other vtable. Naturally, we are making an assumption that the relative offsets of vtables don't change!