pub struct JsCompiledFunction { /* private fields */ }
Expand description
A bytecode compiled function.
Implementations§
Source§impl JsCompiledFunction
impl JsCompiledFunction
Sourcepub fn eval(&self) -> Result<OwnedJsValue, ExecutionError>
pub fn eval(&self) -> Result<OwnedJsValue, ExecutionError>
Evaluate this compiled function and return the resulting value.
Sourcepub fn to_bytecode(&self) -> Result<Vec<u8>, ExecutionError>
pub fn to_bytecode(&self) -> Result<Vec<u8>, ExecutionError>
Convert this compiled function into QuickJS bytecode.
Bytecode can be stored and loaded with [Context::compile
].
Trait Implementations§
Source§impl Clone for JsCompiledFunction
impl Clone for JsCompiledFunction
Source§fn clone(&self) -> JsCompiledFunction
fn clone(&self) -> JsCompiledFunction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for JsCompiledFunction
impl Debug for JsCompiledFunction
Source§impl TryFrom<OwnedJsValue> for JsCompiledFunction
impl TryFrom<OwnedJsValue> for JsCompiledFunction
Source§type Error = ValueError
type Error = ValueError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for JsCompiledFunction
impl RefUnwindSafe for JsCompiledFunction
impl Send for JsCompiledFunction
impl Sync for JsCompiledFunction
impl Unpin for JsCompiledFunction
impl UnwindSafe for JsCompiledFunction
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