pub struct JavascriptFunction {
pub private_names: Vec<String>,
/* private fields */
}Expand description
Inspectable callable metadata. Shared plans and capture cells own neutral mechanics; this record retains only JavaScript and object-system policy.
Fields§
§private_names: Vec<String>Declared private names for a class constructor.
Implementations§
Source§impl JavascriptFunction
impl JavascriptFunction
Sourcepub fn new(
plan: FunctionPlan,
captures: Vec<CapturedBinding>,
policy: JavascriptFunctionPolicy,
private_names: Vec<String>,
) -> Result<Self, InstanceError>
pub fn new( plan: FunctionPlan, captures: Vec<CapturedBinding>, policy: JavascriptFunctionPolicy, private_names: Vec<String>, ) -> Result<Self, InstanceError>
Freezes a JavaScript function over an already validated neutral plan.
Sourcepub const fn plan(&self) -> &FunctionPlan
pub const fn plan(&self) -> &FunctionPlan
Borrows the shared immutable declaration plan.
Sourcepub fn captures(&self) -> &[CapturedBinding]
pub fn captures(&self) -> &[CapturedBinding]
Borrows exact capture cells in frozen plan order.
Sourcepub const fn policy(&self) -> &JavascriptFunctionPolicy
pub const fn policy(&self) -> &JavascriptFunctionPolicy
Borrows JavaScript-only callable policy.
Sourcepub fn bind_arguments(
&self,
arguments: &[JavascriptValue],
) -> Result<BTreeMap<Symbol, Vec<JavascriptValue>>, JavascriptCallError>
pub fn bind_arguments( &self, arguments: &[JavascriptValue], ) -> Result<BTreeMap<Symbol, Vec<JavascriptValue>>, JavascriptCallError>
Applies ECMAScript positional, default, and rest rules to raw values.
Trait Implementations§
Source§impl Clone for JavascriptFunction
impl Clone for JavascriptFunction
Source§fn clone(&self) -> JavascriptFunction
fn clone(&self) -> JavascriptFunction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for JavascriptFunction
impl RefUnwindSafe for JavascriptFunction
impl Send for JavascriptFunction
impl Sync for JavascriptFunction
impl Unpin for JavascriptFunction
impl UnsafeUnpin for JavascriptFunction
impl UnwindSafe for JavascriptFunction
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