Struct boa::class::ClassBuilder [−][src]
pub struct ClassBuilder<'context> { /* fields omitted */ }Expand description
Class builder which allows adding methods and static methods to the class.
Implementations
Add a method to the class.
It is added to prototype.
pub fn static_method<N>(
&mut self,
name: N,
length: usize,
function: NativeFunction
) -> &mut Self where
N: AsRef<str>,
pub fn static_method<N>(
&mut self,
name: N,
length: usize,
function: NativeFunction
) -> &mut Self where
N: AsRef<str>,
Add a static method to the class.
It is added to class object itself.
Add a data property to the class, with the specified attribute.
It is added to prototype.
pub fn static_property<K, V>(
&mut self,
key: K,
value: V,
attribute: Attribute
) -> &mut Self where
K: Into<PropertyKey>,
V: Into<JsValue>,
pub fn static_property<K, V>(
&mut self,
key: K,
value: V,
attribute: Attribute
) -> &mut Self where
K: Into<PropertyKey>,
V: Into<JsValue>,
Add a static data property to the class, with the specified attribute.
It is added to class object itself.
Add an accessor property to the class, with the specified attribute.
It is added to prototype.
pub fn static_accessor<K>(
&mut self,
key: K,
get: Option<JsObject>,
set: Option<JsObject>,
attribute: Attribute
) -> &mut Self where
K: Into<PropertyKey>,
pub fn static_accessor<K>(
&mut self,
key: K,
get: Option<JsObject>,
set: Option<JsObject>,
attribute: Attribute
) -> &mut Self where
K: Into<PropertyKey>,
Add a static accessor property to the class, with the specified attribute.
It is added to class object itself.
pub fn property_descriptor<K, P>(&mut self, key: K, property: P) -> &mut Self where
K: Into<PropertyKey>,
P: Into<PropertyDescriptor>,
pub fn property_descriptor<K, P>(&mut self, key: K, property: P) -> &mut Self where
K: Into<PropertyKey>,
P: Into<PropertyDescriptor>,
Add a property descriptor to the class, with the specified attribute.
It is added to prototype.
pub fn static_property_descriptor<K, P>(
&mut self,
key: K,
property: P
) -> &mut Self where
K: Into<PropertyKey>,
P: Into<PropertyDescriptor>,
pub fn static_property_descriptor<K, P>(
&mut self,
key: K,
property: P
) -> &mut Self where
K: Into<PropertyKey>,
P: Into<PropertyDescriptor>,
Add a static property descriptor to the class, with the specified attribute.
It is added to class object itself.