Trait bones_framework::lib::prelude::bones_schema::raw_fns::RawClone

source ·
pub trait RawClone {
    // Required method
    unsafe fn raw_clone(src: *const c_void, dst: *mut c_void);

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

Trait implemented automatically for types that implement Clone and can be used to clone the type through raw pointers.

Required Methods§

source

unsafe fn raw_clone(src: *const c_void, dst: *mut c_void)

Write the default value of the type to the pointer.

§Safety

The dst pointer must be aligned, writable, and have the same layout that this function is assocated to, and the src pointer must be readable and point to a valid instance of the type that this function is associated with.

Provided Methods§

source

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

Get a callback suitable for [SchemaData].

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> RawClone for T
where T: Clone,