[−][src]Struct rusty_v8::FunctionTemplate
A FunctionTemplate is used to create functions at runtime. There can only be one function created from a FunctionTemplate in a context. The lifetime of the created function is equal to the lifetime of the context. So in case the embedder needs to create temporary functions that can be collected using Scripts is preferred.
Any modification of a FunctionTemplate after first instantiation will trigger a crash.
A FunctionTemplate can have properties, these properties are added to the function object when it is created.
A FunctionTemplate has a corresponding instance template which is used to create object instances when the function is used as a constructor. Properties added to the instance template are added to each object instance.
A FunctionTemplate can have a prototype template. The prototype template is used to create the prototype object of the function.
Methods
impl FunctionTemplate
[src]
pub fn new<'sc>(
scope: &mut impl ToLocal<'sc>,
callback: extern "C" fn(_: &FunctionCallbackInfo)
) -> Local<'sc, FunctionTemplate>
[src]
scope: &mut impl ToLocal<'sc>,
callback: extern "C" fn(_: &FunctionCallbackInfo)
) -> Local<'sc, FunctionTemplate>
Creates a function template.
pub fn get_function<'sc>(
&mut self,
scope: &mut impl ToLocal<'sc>,
context: Local<Context>
) -> Option<Local<'sc, Function>>
[src]
&mut self,
scope: &mut impl ToLocal<'sc>,
context: Local<Context>
) -> Option<Local<'sc, Function>>
Returns the unique function instance in the current execution context.
Auto Trait Implementations
impl RefUnwindSafe for FunctionTemplate
impl Send for FunctionTemplate
impl Sync for FunctionTemplate
impl Unpin for FunctionTemplate
impl UnwindSafe for FunctionTemplate
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>,