[][src]Struct boa::class::ClassBuilder

pub struct ClassBuilder<'context> { /* fields omitted */ }

Class builder which allows adding methods and static methods to the class.

Implementations

impl<'context> ClassBuilder<'context>[src]

pub fn method<N>(
    &mut self,
    name: N,
    length: usize,
    function: NativeFunction
) -> &mut Self where
    N: AsRef<str>, 
[src]

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>, 
[src]

Add a static method to the class.

It is added to class 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]

Add a 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<Value>, 
[src]

Add a static property to the class, with the specified attribute.

It is added to class object itself.

pub fn context(&mut self) -> &mut Context[src]

Return the current context.

Trait Implementations

impl<'context> Debug for ClassBuilder<'context>[src]

Auto Trait Implementations

impl<'context> !RefUnwindSafe for ClassBuilder<'context>[src]

impl<'context> !Send for ClassBuilder<'context>[src]

impl<'context> !Sync for ClassBuilder<'context>[src]

impl<'context> Unpin for ClassBuilder<'context>[src]

impl<'context> !UnwindSafe for ClassBuilder<'context>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,