[][src]Trait boa::class::Class

pub trait Class: NativeObject + Sized {
    const NAME: &'static str;
    const LENGTH: usize;
    const ATTRIBUTE: Attribute;

    fn constructor(
        this: &Value,
        args: &[Value],
        ctx: &mut Context
    ) -> Result<Self>;
fn init(class: &mut ClassBuilder<'_>) -> Result<()>; }

Native class.

Associated Constants

const NAME: &'static str

The binding name of the object.

const LENGTH: usize

The amount of arguments the class constructor takes, default is 0.

const ATTRIBUTE: Attribute

The attibutes the class will be binded with, default is writable, enumerable, configurable.

Loading content...

Required methods

fn constructor(this: &Value, args: &[Value], ctx: &mut Context) -> Result<Self>

The constructor of the class.

fn init(class: &mut ClassBuilder<'_>) -> Result<()>

Initializes the internals and the methods of the class.

Loading content...

Implementors

Loading content...