Skip to main content

Type

Trait Type 

Source
pub trait Type {
    // Required methods
    fn name(&self) -> &str;
    fn new_instance(self: Rc<Self>) -> Slot;

    // Provided methods
    fn full_name(&self) -> String { ... }
    fn as_class(self: Rc<Self>) -> Option<Rc<dyn Class>> { ... }
}

Required Methods§

Source

fn name(&self) -> &str

Returns the simple name of the type.

Source

fn new_instance(self: Rc<Self>) -> Slot

Creates a new instance of the type, returning a Slot that can be used

Provided Methods§

Source

fn full_name(&self) -> String

Returns the fully qualified name of the type, including any parent class names.

Source

fn as_class(self: Rc<Self>) -> Option<Rc<dyn Class>>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§