datex_core/runtime/execution/
macros.rs1pub(crate) macro interrupt($input:expr, $arg:expr) {{
3 yield Ok($arg);
4 $input.take_result()
5}}
6
7pub(crate) macro interrupt_with_maybe_value {
10 ($input:expr, $arg:expr) => {{
11 use crate::runtime::execution::macros::interrupt;
12
13 let res = interrupt!($input, $arg).unwrap();
14 match res {
15 crate::runtime::execution::execution_loop::interrupts::InterruptResult::ResolvedValue(value) => value,
16 _ => unreachable!(),
17 }
18 }}
19}
20
21pub(crate) macro interrupt_with_borrowed_args_and_maybe_result {
23 ($input:expr, $arg:expr) => {{
24 use crate::runtime::execution::macros::interrupt;
25
26 let res = interrupt!($input, $arg).unwrap();
27 match res {
28 crate::runtime::execution::execution_loop::interrupts::InterruptResult::ResolvedValueAndBorrowedArgs((value, args)) => (value, args),
29 _ => unreachable!(),
30 }
31 }}
32}
33
34pub(crate) macro interrupt_with_value($input:expr, $arg:expr) {{
37 use crate::runtime::execution::macros::interrupt_with_maybe_value;
38 let maybe_value = interrupt_with_maybe_value!($input, $arg);
39 if let Some(value) = maybe_value {
40 value
41 } else {
42 unreachable!();
43 }
44}}
45
46#[allow(unused_macros)]
49pub(crate) macro interrupt_with_values {
50 ($input:expr, $arg:expr) => {{
51 use crate::runtime::execution::macros::interrupt;
52 let res = interrupt!($input, $arg).unwrap();
53 match res {
54 crate::runtime::execution::execution_loop::interrupts::InterruptResult::ResolvedValues(values) => values,
55 _ => unreachable!(),
56 }
57 }}
58}