pub struct FunctionOptions {
pub name: String,
pub length: u32,
pub constructor: bool,
pub data: Vec<Value>,
}Expand description
How a host function is made: its name and length, whether new may
call it, and the values it captures (Scope::data). Captured values are
traced by the collector; a Rust value the closure captures is not.
Fields§
§name: String§length: u32§constructor: bool§data: Vec<Value>Implementations§
Source§impl FunctionOptions
impl FunctionOptions
pub fn new(name: impl Into<String>) -> Self
pub fn length(self, length: u32) -> Self
Sourcepub fn constructor(self) -> Self
pub fn constructor(self) -> Self
The function may be called by new (Scope::is_construct). It
has no prototype property until the embedder defines one.
pub fn data(self, data: Vec<Value>) -> Self
Trait Implementations§
Source§impl Clone for FunctionOptions
impl Clone for FunctionOptions
Source§impl Debug for FunctionOptions
impl Debug for FunctionOptions
Auto Trait Implementations§
impl !RefUnwindSafe for FunctionOptions
impl !Send for FunctionOptions
impl !Sync for FunctionOptions
impl !UnwindSafe for FunctionOptions
impl Freeze for FunctionOptions
impl Unpin for FunctionOptions
impl UnsafeUnpin for FunctionOptions
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