ClassDefinition

Trait ClassDefinition 

Source
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§

Provided Methods§

Source

fn proto_class() -> Option<&'static NativeClass>

Source

fn parent_prototype(_: &Context) -> Option<Local<'_, *mut JSObject>>

Source

fn functions() -> Option<&'static [JSFunctionSpec]>

Source

fn properties() -> Option<&'static [JSPropertySpec]>

Source

fn static_functions() -> Option<&'static [JSFunctionSpec]>

Source

fn static_properties() -> Option<&'static [JSPropertySpec]>

Source

fn init_class<'cx>( cx: &'cx Context, object: &Object<'_>, ) -> (bool, &'cx ClassInfo)

Source

fn new_raw_object(cx: &Context) -> *mut JSObject

Source

fn new_object(cx: &Context, native: Box<Self>) -> *mut JSObject

Source

unsafe fn get_private_unchecked<'a>(object: &Object<'a>) -> &'a Self

Source

fn get_private<'a>(cx: &Context, object: &Object<'a>) -> Result<&'a Self>

Source

unsafe fn get_mut_private_unchecked<'a>(object: &Object<'a>) -> &'a mut Self

Source

fn get_mut_private<'a>( cx: &Context, object: &Object<'a>, ) -> Result<&'a mut Self>

Source

unsafe fn set_private(object: *mut JSObject, native: Box<Self>)

Source

fn instance_of(cx: &Context, object: &Object<'_>) -> bool

Source

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.

Implementors§