sparkles_core/
config.rs

1#[derive(Copy, Clone, Debug)]
2pub struct LocalStorageConfig {
3    /// Soft threshold for flushing. Will flush automatically only if global buffer is available at the moment.
4    /// 
5    /// Default: 32KB
6    pub flush_attempt_threshold: usize,
7    /// Max capacity of the thread-local storage buffer in bytes. After reaching this threshold,
8    /// the buffer will be flushed to the global storage. Thread will be blocked until the flushing operation is finished.
9    /// 
10    /// Default: 1MB
11    pub flush_threshold: usize,
12}
13
14impl LocalStorageConfig {
15    #[must_use]
16    pub const fn default() -> Self {
17        Self {
18            flush_attempt_threshold: 32*1024,
19            flush_threshold: 1024*1024,
20        }
21    }
22}
23
24impl Default for LocalStorageConfig {
25    fn default() -> Self {
26        Self::default()
27    }
28}