Trait gluon_vm::gc::DataDef [] [src]

pub unsafe trait DataDef {
    type Value: ?Sized + for<'a> FromPtr<&'a Self>;
    fn size(&self) -> usize;
    fn initialize<'w>(self, ptr: WriteOnly<'w, Self::Value>) -> &'w mut Self::Value;
}

A definition of some data which may be allocated by the garbage collector.

Associated Types

type Value: ?Sized + for<'a> FromPtr<&'a Self>

The type of the value allocated.

Required Methods

fn size(&self) -> usize

Returns how many bytes need to be allocted for this DataDef

fn initialize<'w>(self, ptr: WriteOnly<'w, Self::Value>) -> &'w mut Self::Value

Consumes self to initialize the allocated value. Returns the initialized pointer.

Implementors