Trait 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) + Sync + Send + 'static)> { ... }
}
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) + Sync + Send + 'static)>

Get a callback suitable for SchemaData.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: Clone> RawClone for T