pub trait ClassDefinition: NativeObject {
Show 18 methods
// Required methods
fn class() -> &'static NativeClass;
fn constructor() -> (Option<NativeFunction>, u32);
// Provided methods
fn proto_class() -> Option<&'static NativeClass> { ... }
fn parent_prototype(_: &Context) -> Option<Local<'_, *mut JSObject>> { ... }
fn functions() -> Option<&'static [JSFunctionSpec]> { ... }
fn properties() -> Option<&'static [JSPropertySpec]> { ... }
fn static_functions() -> Option<&'static [JSFunctionSpec]> { ... }
fn static_properties() -> Option<&'static [JSPropertySpec]> { ... }
fn init_class<'cx>(
cx: &'cx Context,
object: &Object<'_>,
) -> (bool, &'cx ClassInfo) { ... }
fn new_raw_object(cx: &Context) -> *mut JSObject { ... }
fn new_object(cx: &Context, native: Box<Self>) -> *mut JSObject { ... }
unsafe fn get_private_unchecked<'a>(object: &Object<'a>) -> &'a Self { ... }
fn get_private<'a>(cx: &Context, object: &Object<'a>) -> Result<&'a Self> { ... }
unsafe fn get_mut_private_unchecked<'a>(object: &Object<'a>) -> &'a mut Self { ... }
fn get_mut_private<'a>(
cx: &Context,
object: &Object<'a>,
) -> Result<&'a mut Self> { ... }
unsafe fn set_private(object: *mut JSObject, native: Box<Self>) { ... }
fn instance_of(cx: &Context, object: &Object<'_>) -> bool { ... }
fn has_instance(cx: &Context, object: &Object<'_>) -> Result<bool> { ... }
}Required Methods§
fn class() -> &'static NativeClass
fn constructor() -> (Option<NativeFunction>, u32)
Provided Methods§
fn proto_class() -> Option<&'static NativeClass>
fn parent_prototype(_: &Context) -> Option<Local<'_, *mut JSObject>>
fn functions() -> Option<&'static [JSFunctionSpec]>
fn properties() -> Option<&'static [JSPropertySpec]>
fn static_functions() -> Option<&'static [JSFunctionSpec]>
fn static_properties() -> Option<&'static [JSPropertySpec]>
fn init_class<'cx>( cx: &'cx Context, object: &Object<'_>, ) -> (bool, &'cx ClassInfo)
fn new_raw_object(cx: &Context) -> *mut JSObject
fn new_object(cx: &Context, native: Box<Self>) -> *mut JSObject
unsafe fn get_private_unchecked<'a>(object: &Object<'a>) -> &'a Self
fn get_private<'a>(cx: &Context, object: &Object<'a>) -> Result<&'a Self>
unsafe fn get_mut_private_unchecked<'a>(object: &Object<'a>) -> &'a mut Self
fn get_mut_private<'a>( cx: &Context, object: &Object<'a>, ) -> Result<&'a mut Self>
unsafe fn set_private(object: *mut JSObject, native: Box<Self>)
fn instance_of(cx: &Context, object: &Object<'_>) -> bool
fn has_instance(cx: &Context, object: &Object<'_>) -> Result<bool>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.