Trait boa_engine::class::Class

source ·
pub trait Class: NativeObject + Sized {
    const NAME: &'static str;
    const LENGTH: usize = 0usize;
    const ATTRIBUTES: Attribute = _;

    // Required methods
    fn constructor(
        this: &JsValue,
        args: &[JsValue],
        context: &mut Context<'_>
    ) -> JsResult<Self>;
    fn init(class: &mut ClassBuilder<'_, '_>) -> JsResult<()>;
}
Expand description

Native class.

Required Associated Constants§

source

const NAME: &'static str

The binding name of the object.

Provided Associated Constants§

source

const LENGTH: usize = 0usize

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

source

const ATTRIBUTES: Attribute = _

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

Required Methods§

source

fn constructor( this: &JsValue, args: &[JsValue], context: &mut Context<'_> ) -> JsResult<Self>

The constructor of the class.

source

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

Initializes the internals and the methods of the class.

Implementors§