Trait bones_lib::ecs::prelude::bones_schema::raw_fns::RawDefault

pub trait RawDefault {
    // Required method
    unsafe fn raw_default(dst: *mut c_void);

    // Provided method
    fn raw_default_cb() -> Unsafe<&'static (dyn Fn(*mut c_void) + Send + Sync)> { ... }
}
Expand description

Trait implemented automatically for types that implement Default and can be used to write the default value of the type to a pointer.

Required Methods§

unsafe fn raw_default(dst: *mut c_void)

Write the default value of the type to the pointer.

§Safety

The pointer must be aligned, writable, and have the same layout that this function is assocated to.

Provided Methods§

fn raw_default_cb() -> Unsafe<&'static (dyn Fn(*mut c_void) + Send + Sync)>

Get a callback suitable for [SchemaData].

Object Safety§

This trait is not object safe.

Implementors§

§

impl<T> RawDefault for T
where T: Default,