Struct v8::FunctionBuilder
source · pub struct FunctionBuilder<'s, T> { /* private fields */ }
Expand description
A builder to construct the properties of a Function or FunctionTemplate.
Implementations§
source§impl<'s, T> FunctionBuilder<'s, T>
impl<'s, T> FunctionBuilder<'s, T>
sourcepub fn new(callback: impl MapFnTo<FunctionCallback>) -> Self
pub fn new(callback: impl MapFnTo<FunctionCallback>) -> Self
Create a new FunctionBuilder.
pub fn new_raw(callback: FunctionCallback) -> Self
sourcepub fn data(self, data: Local<'s, Value>) -> Self
pub fn data(self, data: Local<'s, Value>) -> Self
Set the associated data. The default is no associated data.
sourcepub fn constructor_behavior(
self,
constructor_behavior: ConstructorBehavior
) -> Self
pub fn constructor_behavior(
self,
constructor_behavior: ConstructorBehavior
) -> Self
Set the constructor behavior. The default is ConstructorBehavior::Allow.
sourcepub fn side_effect_type(self, side_effect_type: SideEffectType) -> Self
pub fn side_effect_type(self, side_effect_type: SideEffectType) -> Self
Set the side effect type. The default is SideEffectType::HasSideEffect.
source§impl<'s> FunctionBuilder<'s, Function>
impl<'s> FunctionBuilder<'s, Function>
source§impl<'s> FunctionBuilder<'s, FunctionTemplate>
impl<'s> FunctionBuilder<'s, FunctionTemplate>
sourcepub fn signature(self, signature: Local<'s, Signature>) -> Self
pub fn signature(self, signature: Local<'s, Signature>) -> Self
Set the function call signature. The default is no signature.
sourcepub fn build(
self,
scope: &mut HandleScope<'s, ()>
) -> Local<'s, FunctionTemplate>
pub fn build(
self,
scope: &mut HandleScope<'s, ()>
) -> Local<'s, FunctionTemplate>
Creates the function template.