rusty_v8

Struct 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>

Source

pub fn new(callback: impl MapFnTo<FunctionCallback>) -> Self

Create a new FunctionBuilder.

Source

pub fn data(self, data: Local<'s, Value>) -> Self

Set the associated data. The default is no associated data.

Source

pub fn length(self, length: i32) -> Self

Set the function length. The default is 0.

Source

pub fn constructor_behavior( self, constructor_behavior: ConstructorBehavior, ) -> Self

Set the constructor behavior. The default is ConstructorBehavior::Allow.

Source

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>

Source

pub fn build(self, scope: &mut HandleScope<'s>) -> Option<Local<'s, Function>>

Create the function in the current execution context.

Source§

impl<'s> FunctionBuilder<'s, FunctionTemplate>

Source

pub fn signature(self, signature: Local<'s, Signature>) -> Self

Set the function call signature. The default is no signature.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.