Struct janetrs::function::JanetTryState
source · pub struct JanetTryState { /* private fields */ }
Expand description
A structure that holds the old and new states of the Janet VM.
This can be used to execute a JanetCFunction
and capture its Janet panics.
Implementations§
source§impl JanetTryState
impl JanetTryState
sourcepub fn is_valid_to_run(&self) -> bool
pub fn is_valid_to_run(&self) -> bool
Check if the VM have a valid JanetFiber
.
sourcepub unsafe fn signal_unchecked(&mut self) -> JanetSignal
pub unsafe fn signal_unchecked(&mut self) -> JanetSignal
Get the JanetSignal
of the state without checking if the environment is
set to catch Janet Panics.
§Safety
If this is called with the invalid environment to catch Janet Panics it will cause undefined behaviour.
sourcepub fn signal(&mut self) -> Option<JanetSignal>
pub fn signal(&mut self) -> Option<JanetSignal>
Get the JanetSignal
of the state if the environment is set to catch Janet
Panics.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JanetTryState
impl RefUnwindSafe for JanetTryState
impl !Send for JanetTryState
impl !Sync for JanetTryState
impl Unpin for JanetTryState
impl UnwindSafe for JanetTryState
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