pub struct Completion {
pub completion_type: CompletionType,
pub value: Option<JsValue>,
pub target: Option<String>,
}Expand description
Completion record. Every statement evaluation returns a completion record.
Fields§
§completion_type: CompletionTypeThe type of completion.
value: Option<JsValue>The value, if any.
target: Option<String>Target label for break/continue.
Implementations§
Source§impl Completion
impl Completion
Sourcepub fn normal_with_value(value: JsValue) -> Self
pub fn normal_with_value(value: JsValue) -> Self
Create a normal completion with a value.
Sourcepub fn return_value(value: JsValue) -> Self
pub fn return_value(value: JsValue) -> Self
Create a return completion.
Sourcepub fn return_undefined() -> Self
pub fn return_undefined() -> Self
Create a return completion with undefined.
Sourcepub fn throw(error: JErrorType) -> Self
pub fn throw(error: JErrorType) -> Self
Create a throw completion (exception).
Sourcepub fn break_completion(target: Option<String>) -> Self
pub fn break_completion(target: Option<String>) -> Self
Create a break completion.
Sourcepub fn continue_completion(target: Option<String>) -> Self
pub fn continue_completion(target: Option<String>) -> Self
Create a continue completion.
Sourcepub fn yield_value(value: JsValue) -> Self
pub fn yield_value(value: JsValue) -> Self
Create a yield completion with a value.
Sourcepub fn update_empty(self, value: JsValue) -> Self
pub fn update_empty(self, value: JsValue) -> Self
Update the value of a normal completion.
Auto Trait Implementations§
impl Freeze for Completion
impl !RefUnwindSafe for Completion
impl !Send for Completion
impl !Sync for Completion
impl Unpin for Completion
impl !UnwindSafe for Completion
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