Skip to main content

StaticallyNamed

Trait StaticallyNamed 

Source
pub trait StaticallyNamed: NativeClass {
    const CLASS_NAME: &'static str;

    // Provided method
    fn nativeclass_register_monomorphized(_builder: &ClassBuilder<Self>) { ... }
}
Expand description

A NativeScript “class” that is statically named. NativeClass types that implement this trait can be registered using [InitHandle::add_class].

This trait will be renamed to [Monomorphized] in a future version since its purpose has grown beyond simply providing a static type name.

Required Associated Constants§

Source

const CLASS_NAME: &'static str

The name of the class.

This name must be unique for the dynamic library. For generic or library code where this is hard to satisfy, consider using [InitHandle::add_class_as] to provide a name at registration time instead.

Provided Methods§

Source

fn nativeclass_register_monomorphized(_builder: &ClassBuilder<Self>)

Function that registers methods specific to this monomorphization.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§