Skip to main content

FoundationClass

Trait FoundationClass 

Source
pub trait FoundationClass: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn fields(&self) -> &[FoundationField];
    fn instantiate(
        &self,
        fields: &BTreeMap<SymbolId, Value>,
    ) -> Result<Value, RuneError>;
    fn methods(&self) -> &[Box<dyn Verb>];
}
Expand description

A Rust-backed class type that appears as a class in Runes.

Required Methods§

Source

fn name(&self) -> &str

The class name (PascalCase).

Source

fn fields(&self) -> &[FoundationField]

Field definitions.

Source

fn instantiate( &self, fields: &BTreeMap<SymbolId, Value>, ) -> Result<Value, RuneError>

Create a new instance from field values.

Source

fn methods(&self) -> &[Box<dyn Verb>]

Methods available on instances.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§