[−][src]Struct rusty_v8_m::ObjectTemplate
An ObjectTemplate is used to create objects at runtime.
Properties added to an ObjectTemplate are added to each object created from the ObjectTemplate.
Methods
impl ObjectTemplate
[src]
pub fn new<'sc>(scope: &mut impl ToLocal<'sc>) -> Local<'sc, ObjectTemplate>
[src]
Creates an object template.
pub fn new_from_template<'sc>(
scope: &mut impl ToLocal<'sc>,
templ: Local<FunctionTemplate>
) -> Local<'sc, ObjectTemplate>
[src]
scope: &mut impl ToLocal<'sc>,
templ: Local<FunctionTemplate>
) -> Local<'sc, ObjectTemplate>
Creates an object template from a function template.
pub fn new_instance<'a>(
&self,
scope: &mut impl ToLocal<'a>,
context: Local<Context>
) -> Option<Local<'a, Object>>
[src]
&self,
scope: &mut impl ToLocal<'a>,
context: Local<Context>
) -> Option<Local<'a, Object>>
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]
&self,
key: Local<Name>,
value: Local<Data>,
attr: PropertyAttribute
)
Adds a property to each instance created by this template with the specified property attributes.
Trait Implementations
impl Deref for ObjectTemplate
[src]
Auto Trait Implementations
impl RefUnwindSafe for ObjectTemplate
impl Send for ObjectTemplate
impl Sync for ObjectTemplate
impl Unpin for ObjectTemplate
impl UnwindSafe for ObjectTemplate
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,
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.
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>,