tvm_ffi::reflection

Trait ShallowCopy

Source
pub trait ShallowCopy {
    // Required method
    fn shallow_copy(&self) -> Self;
}
Expand description

A copy of an object’s own fields under a fresh object header (the C++ copy constructor), which __ffi_shallow_copy__ returns.

#[derive(Object)] implements it for a type with #[reflect] fields by copying the parent with its ShallowCopy and cloning every other field. A Rust type whose parent is bound from C++ needs that parent to implement it.

Required Methods§

Source

fn shallow_copy(&self) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§