Skip to main content

tape_sdk/
write_options.rs

1//! Client-level knobs for the write paths.
2
3use tape_core::erasure::GROUP_SIZE;
4use tape_core::track::types::TrackVisibility;
5
6/// Write pacing knobs; defaults are the tuned fast path.
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub struct WriteOptions {
9    /// In-flight slice uploads per track write.
10    pub slice_concurrency: usize,
11    /// Stream chunks uploading concurrently; also bounds peak memory.
12    pub store_depth: usize,
13    /// Every track this client writes is registered with this visibility.
14    pub visibility: TrackVisibility,
15}
16
17impl Default for WriteOptions {
18    fn default() -> Self {
19        Self {
20            slice_concurrency: GROUP_SIZE,
21            store_depth: 4,
22            visibility: TrackVisibility::Public,
23        }
24    }
25}
26
27#[cfg(test)]
28mod tests {
29    use super::*;
30
31    #[test]
32    fn defaults() {
33        let options = WriteOptions::default();
34        assert_eq!(options.slice_concurrency, GROUP_SIZE);
35        assert_eq!(options.store_depth, 4);
36        assert_eq!(options.visibility, TrackVisibility::Public);
37    }
38}