Expand description
Module to make Rust subclasses of C++ classes. See CppSubclass
for details.
Modules§
- prelude
- A prelude containing all the traits and macros required to create Rust subclasses of C++ classes. It’s recommended that you:
Traits§
- CppPeerConstructor 
- A trait to be implemented by a subclass which knows how to construct
its C++ peer object. Specifically, the implementation here will
arrange to call one or other of the make_uniquemethods to be found on the superclass of the C++ object. If the superclass has a single trivial constructor, then this is implemented automatically for you. If there are multiple constructors, or a single constructor which takes parameters, you’ll need to implement this trait for your subclass in order to call the correct constructor.
- CppSubclass
- A subclass of a C++ type.
- CppSubclassDefault 
- Provides default constructors for subclasses which implement Default.
- CppSubclassSelf Owned 
- Trait to be implemented by subclasses which are self-owned, i.e. not owned externally by either Rust or C++ code, and thus need the ability to delete themselves when some virtual function is called.
- CppSubclassSelf Owned Default 
- Provides default constructors for subclasses which implement Defaultand are self-owning.
Attribute Macros§
- is_subclass 
- Deprecated - use subclassinstead. Attribute to state that a Ruststructis a C++ subclass. This adds an additional field to the struct which autocxx uses to track a C++ instantiation of this Rust subclass.
- subclass
- Declare a Rust subclass of a C++ class. You can use this in two ways: