[][src]Struct rusty_v8::ObjectTemplate

#[repr(C)]pub struct ObjectTemplate(_);

An ObjectTemplate is used to create objects at runtime.

Properties added to an ObjectTemplate are added to each object created from the ObjectTemplate.

Implementations

impl ObjectTemplate[src]

pub fn new<'s>(scope: &mut HandleScope<'s, ()>) -> Local<'s, ObjectTemplate>[src]

Creates an object template.

pub fn new_from_template<'s>(
    scope: &mut HandleScope<'s, ()>,
    templ: Local<FunctionTemplate>
) -> Local<'s, ObjectTemplate>
[src]

Creates an object template from a function template.

pub fn new_instance<'s>(
    &self,
    scope: &mut HandleScope<'s>
) -> Option<Local<'s, Object>>
[src]

Creates a new instance of this object template.

Methods from Deref<Target = Template>

pub fn set(&self, key: Local<Name>, value: Local<Data>)[src]

Adds a property to each instance created by this template.

pub fn set_with_attr(
    &self,
    key: Local<Name>,
    value: Local<Data>,
    attr: PropertyAttribute
)
[src]

Adds a property to each instance created by this template with the specified property attributes.

Trait Implementations

impl Deref for ObjectTemplate[src]

type Target = Template

The resulting type after dereferencing.

impl Eq for ObjectTemplate[src]

impl Hash for ObjectTemplate[src]

impl<'s> PartialEq<Data> for ObjectTemplate[src]

impl<'s> PartialEq<ObjectTemplate> for Data[src]

impl<'s> PartialEq<ObjectTemplate> for Template[src]

impl<'s> PartialEq<ObjectTemplate> for ObjectTemplate[src]

impl<'s> PartialEq<Template> for ObjectTemplate[src]

Auto Trait Implementations

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.