pub(crate) macro interrupt($input:expr, $arg:expr) {{
yield Ok($arg);
$input.take_result()
}}
pub(crate) macro interrupt_with_maybe_value {
($input:expr, $arg:expr) => {{
use crate::runtime::execution::macros::interrupt;
let res = interrupt!($input, $arg).unwrap();
match res {
crate::runtime::execution::execution_loop::interrupts::InterruptResult::ResolvedValue(value) => value,
_ => unreachable!(),
}
}}
}
pub(crate) macro interrupt_with_borrowed_args_and_maybe_result {
($input:expr, $arg:expr) => {{
use crate::runtime::execution::macros::interrupt;
let res = interrupt!($input, $arg).unwrap();
match res {
crate::runtime::execution::execution_loop::interrupts::InterruptResult::ResolvedValueAndBorrowedArgs((value, args)) => (value, args),
_ => unreachable!(),
}
}}
}
pub(crate) macro interrupt_with_value($input:expr, $arg:expr) {{
use crate::runtime::execution::macros::interrupt_with_maybe_value;
let maybe_value = interrupt_with_maybe_value!($input, $arg);
if let Some(value) = maybe_value {
value
} else {
unreachable!();
}
}}
#[allow(unused_macros)]
pub(crate) macro interrupt_with_values {
($input:expr, $arg:expr) => {{
use crate::runtime::execution::macros::interrupt;
let res = interrupt!($input, $arg).unwrap();
match res {
crate::runtime::execution::execution_loop::interrupts::InterruptResult::ResolvedValues(values) => values,
_ => unreachable!(),
}
}}
}