Skip to main content

rskit_dataset/
limits.rs

1use serde::{Deserialize, Serialize};
2
3/// Default threshold above which payloads should be represented as files.
4pub const DEFAULT_MAX_IN_MEMORY_BYTES: usize = 8 * 1024 * 1024;
5
6/// Runtime limits for dataset streaming and bounded materialization.
7#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
8pub struct DatasetLimits {
9    /// Largest payload that may be held in memory by bounded helpers.
10    pub max_in_memory_bytes: usize,
11    /// Bounded channel capacity for source/collector stream plumbing.
12    pub stream_buffer: usize,
13}
14
15impl Default for DatasetLimits {
16    fn default() -> Self {
17        Self {
18            max_in_memory_bytes: DEFAULT_MAX_IN_MEMORY_BYTES,
19            stream_buffer: 64,
20        }
21    }
22}