UserData

Trait UserData 

Source
pub trait UserData: Any {
    // Required methods
    fn dtable_gcraw(&self) -> GcRaw<DispatchTable>;
    fn as_any(&self) -> &dyn Any;

    // Provided method
    unsafe fn dtable(&self) -> &DispatchTable { ... }
}

Required Methods§

Source

fn dtable_gcraw(&self) -> GcRaw<DispatchTable>

Returns a GC reference to the user data’s dispatch table.

Source

fn as_any(&self) -> &dyn Any

Converts a reference to UserData to Any.

Provided Methods§

Source

unsafe fn dtable(&self) -> &DispatchTable

Returns the user data’s dispatch table.

§Safety

This is basically sugar for dtable_gcraw().get(), so all the footguns of GcRaw::get apply.

Implementors§