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§
Provided Associated Constants§
sourceconst LENGTH: usize = 0usize
const LENGTH: usize = 0usize
The amount of arguments the class constructor takes, default is 0.
sourceconst ATTRIBUTES: Attribute = _
const ATTRIBUTES: Attribute = _
The attributes the class will be binded with, default is writable, enumerable, configurable.
Required Methods§
sourcefn constructor(
this: &JsValue,
args: &[JsValue],
context: &mut Context<'_>
) -> JsResult<Self>
fn constructor( this: &JsValue, args: &[JsValue], context: &mut Context<'_> ) -> JsResult<Self>
The constructor of the class.
sourcefn init(class: &mut ClassBuilder<'_, '_>) -> JsResult<()>
fn init(class: &mut ClassBuilder<'_, '_>) -> JsResult<()>
Initializes the internals and the methods of the class.