pub struct Script {
pub source: String,
pub timeout: Option<Duration>,
pub origin: Option<ScriptOrigin>,
}
Fields§
§source: String
The source of the script.
timeout: Option<Duration>
The maximum runtime duration of the script’s execution. This cannot be set within a nested
evaluation, i.e. it cannot be set when calling MiniV8::eval
from within a Function
created with MiniV8::create_function
or MiniV8::create_function_mut
.
V8 can only cancel script evaluation while running actual JavaScript code. If Rust code is being executed when the timeout is triggered, the execution will continue until the evaluation has returned to running JavaScript code.
origin: Option<ScriptOrigin>
The script’s origin.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Script
impl RefUnwindSafe for Script
impl Send for Script
impl Sync for Script
impl Unpin for Script
impl UnwindSafe for Script
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