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.
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.
Auto Trait Implementations§
impl<'s, T> Freeze for FunctionBuilder<'s, T>
impl<'s, T> RefUnwindSafe for FunctionBuilder<'s, T>where
T: RefUnwindSafe,
impl<'s, T> !Send for FunctionBuilder<'s, T>
impl<'s, T> !Sync for FunctionBuilder<'s, T>
impl<'s, T> Unpin for FunctionBuilder<'s, T>where
T: Unpin,
impl<'s, T> UnwindSafe for FunctionBuilder<'s, T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more