pub trait Class: NativeObject + Sized {
const NAME: &'static str;
const LENGTH: usize = 0;
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 ATTRIBUTES: Attribute = _
const ATTRIBUTES: Attribute = _
The attibutes 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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".