1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Global constants for the framework.
/// The highest possible version of a [`Machine`](crate::Machine) supported by
/// this framework.
pub const VERSION: u8 = 2;
/// The maximum size of a decompressed encoded [`Machine`](crate::Machine) in
/// bytes. Set to 1MB. This is a soft limit and can be increased if necessary.
pub const MAX_DECOMPRESSED_SIZE: usize = 1 << 20;
/// The number of [`Event`](crate::event)s in the framework.
pub const EVENT_NUM: usize = 13;
/// The maximum sampled timeout in a [`State`](crate::state), set to a day in
/// microseconds.
pub const MAX_SAMPLED_TIMEOUT: f64 = 24.0 * 60.0 * 60.0 * 1000.0 * 1000.0;
/// The maximum sampled timer duration in a [`State`](crate::state), set to a
/// day in microseconds.
pub const MAX_SAMPLED_TIMER_DURATION: f64 = 24.0 * 60.0 * 60.0 * 1000.0 * 1000.0;
/// The maximum sampled blocking duration in a [`State`](crate::state), set to a
/// day in microseconds.
pub const MAX_SAMPLED_BLOCK_DURATION: f64 = 24.0 * 60.0 * 60.0 * 1000.0 * 1000.0;
/// The maximum possible sampled limit of a [`State`](crate::state). This is the
/// default if no limit dist is specified (in practice, the same as no limit).
pub const STATE_LIMIT_MAX: u64 = u64MAX;
/// A pseudo-state that means the [`Machine`](crate::Machine) should completely
/// stop.
pub const STATE_END: usize = u32MAX as usize;
/// A pseudo-state that triggers a Signal [`Event`](crate::event) in all other
/// running machines.
pub const STATE_SIGNAL: usize = STATE_END - 1;
/// The maximum number of [`State`](crate::state)s a [`Machine`](crate::Machine)
/// can have. Set to 100,000 as a safety measure to prevent resource exhaustion.
/// Likely much higher than `MAX_DECOMPRESSED_SIZE` allows for as-is.
pub const STATE_MAX: usize = 100_000;