autocxx::subclass

Trait CppSubclassDefault

Source
pub trait CppSubclassDefault<CppPeer: CppSubclassCppPeer>: CppSubclass<CppPeer> + Default {
    // Required methods
    fn default_rust_owned() -> Rc<RefCell<Self>>;
    fn default_cpp_owned() -> UniquePtr<CppPeer> ;
}
Expand description

Provides default constructors for subclasses which implement Default.

Required Methods§

Source

fn default_rust_owned() -> Rc<RefCell<Self>>

Create a Rust-owned instance of this subclass, initializing with default values. See CppSubclass for more details of the ownership models available.

Source

fn default_cpp_owned() -> UniquePtr<CppPeer>

Create a C++-owned instance of this subclass, initializing with default values. See CppSubclass for more details of the ownership models available.

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§

Source§

impl<T, CppPeer> CppSubclassDefault<CppPeer> for T
where T: CppSubclass<CppPeer> + Default, CppPeer: CppSubclassCppPeer,