Trait spaik::Fissile

source ·
pub unsafe trait Fissile: LispFmt + Debug + Clone + Traceable + Any + 'static {
    // Required method
    fn type_of() -> NkT;
}
Expand description

Structs that can be stored inline in the GC Arena memory must implement this trait.

Safety

No. Not safe. Do not implement this trait directly.

Add your new internal heap-storage type to the fissile_types! {...} list, or just use Object. This is essentially just a marker-type.

What makes it really gnarly to implement this trait yourself, without adding it to fissile_types! {...} is that type_of() is used as an index into DESTRUCTORS when deallocating unreachable GC objects, and to figure out which pointers to follow during the GC mark phase. This will obviously cause UB if the memory layout of your type isn’t what the destructor, or trace/update_ptrs expects

Required Methods§

source

fn type_of() -> NkT

Implementations on Foreign Types§

source§

impl Fissile for Vec<PV>

source§

fn type_of() -> NkT

source§

impl Fissile for Mat3

source§

fn type_of() -> NkT

source§

impl Fissile for String

source§

fn type_of() -> NkT

source§

impl Fissile for Vec4

source§

fn type_of() -> NkT

source§

impl Fissile for Mat2

source§

fn type_of() -> NkT

source§

impl Fissile for Mat4

source§

fn type_of() -> NkT

source§

impl Fissile for Box<dyn Subr>

source§

fn type_of() -> NkT

Implementors§