[−][src]Struct boa::object::ConstructorBuilder
Builder for creating constructors objects, like Array.
Implementations
impl<'context> ConstructorBuilder<'context>[src]
pub fn new(context: &'context mut Context, constructor: NativeFunction) -> Self[src]
Create a new ConstructorBuilder.
pub fn method<B>(
&mut self,
function: NativeFunction,
binding: B,
length: usize
) -> &mut Self where
B: Into<FunctionBinding>, [src]
&mut self,
function: NativeFunction,
binding: B,
length: usize
) -> &mut Self where
B: Into<FunctionBinding>,
Add new method to the constructors prototype.
pub fn static_method<B>(
&mut self,
function: NativeFunction,
binding: B,
length: usize
) -> &mut Self where
B: Into<FunctionBinding>, [src]
&mut self,
function: NativeFunction,
binding: B,
length: usize
) -> &mut Self where
B: Into<FunctionBinding>,
Add new static method to the constructors object itself.
pub fn property<K, V>(
&mut self,
key: K,
value: V,
attribute: Attribute
) -> &mut Self where
K: Into<PropertyKey>,
V: Into<Value>, [src]
&mut self,
key: K,
value: V,
attribute: Attribute
) -> &mut Self where
K: Into<PropertyKey>,
V: Into<Value>,
Add new property to the constructors prototype.
pub fn static_property<K, V>(
&mut self,
key: K,
value: V,
attribute: Attribute
) -> &mut Self where
K: Into<PropertyKey>,
V: Into<Value>, [src]
&mut self,
key: K,
value: V,
attribute: Attribute
) -> &mut Self where
K: Into<PropertyKey>,
V: Into<Value>,
Add new static property to the constructors object itself.
pub fn length(&mut self, length: usize) -> &mut Self[src]
Specify how many arguments the constructor function takes.
Default is 0.
pub fn name<N>(&mut self, name: N) -> &mut Self where
N: AsRef<str>, [src]
N: AsRef<str>,
Specify the name of the constructor function.
Default is "[object]"
pub fn callable(&mut self, callable: bool) -> &mut Self[src]
Specify whether the constructor function can be called.
Default is true
pub fn constructable(&mut self, constructable: bool) -> &mut Self[src]
Specify whether the constructor function can be called with new keyword.
Default is true
pub fn inherit(&mut self, prototype: Value) -> &mut Self[src]
Specify the prototype this constructor object inherits from.
Default is Object.prototype
pub fn context(&mut self) -> &mut Context[src]
Return the current context.
pub fn build(&mut self) -> GcObject[src]
Build the constructor function object.
Trait Implementations
Auto Trait Implementations
impl<'context> !RefUnwindSafe for ConstructorBuilder<'context>[src]
impl<'context> !Send for ConstructorBuilder<'context>[src]
impl<'context> !Sync for ConstructorBuilder<'context>[src]
impl<'context> Unpin for ConstructorBuilder<'context>[src]
impl<'context> !UnwindSafe for ConstructorBuilder<'context>[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,