Skip to main content

ClassConstructor

Trait ClassConstructor 

Source
#[doc(hidden)]
pub trait ClassConstructor<Block> { }
Expand description

Implemented by #[miniextendr] for each type with an impl block that declares its class constructor (#[miniextendr(<system>(constructor))], or a receiver-less new returning Self). Block is a type private to that impl block, so two such blocks don’t conflict here; the wrapper writer refuses them (merge_class_blocks).

An impl block with several methods that could be the constructor and none declared requires it (require_class_constructor): the type then compiles only when another of its impl blocks declares the constructor.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§