Skip to main content

runmat_runtime/replay/
limits.rs

1#[derive(Debug, Clone, Copy)]
2pub struct ReplayLimits {
3    pub max_scene_payload_bytes: usize,
4    pub max_scene_plots: usize,
5    pub max_workspace_payload_bytes: usize,
6    pub max_workspace_mat_bytes: usize,
7    pub max_workspace_variables: usize,
8}
9
10impl ReplayLimits {
11    pub const DEFAULT: Self = Self {
12        // Figure scene payloads can be large for dense 3D subplots (e.g. surf + scatter3 in a
13        // 2x1 grid). Keep this aligned with desktop replay object budgeting defaults so valid
14        // scenes persist/rehydrate instead of being dropped at export time.
15        max_scene_payload_bytes: 16 * 1024 * 1024,
16        max_scene_plots: 4096,
17        max_workspace_payload_bytes: 32 * 1024 * 1024,
18        max_workspace_mat_bytes: 24 * 1024 * 1024,
19        max_workspace_variables: 2048,
20    };
21}
22
23impl Default for ReplayLimits {
24    fn default() -> Self {
25        Self::DEFAULT
26    }
27}