Skip to main content

memscope_rs/capture/backends/
export_options.rs

1//! Export options for memory tracking
2
3/// Export options for JSON export - user-controllable settings
4#[derive(Debug, Clone)]
5pub struct ExportOptions {
6    /// Include system allocations in full enrichment (default: false)
7    pub include_system_allocations: bool,
8    /// Enable verbose logging during export (default: false)
9    pub verbose_logging: bool,
10    /// Buffer size for file I/O in bytes (default: 64KB)
11    pub buffer_size: usize,
12}
13
14impl Default for ExportOptions {
15    fn default() -> Self {
16        Self {
17            include_system_allocations: false,
18            verbose_logging: false,
19            buffer_size: 64 * 1024,
20        }
21    }
22}
23
24impl ExportOptions {
25    pub fn new() -> Self {
26        Self::default()
27    }
28
29    pub fn include_system_allocations(mut self, include: bool) -> Self {
30        self.include_system_allocations = include;
31        self
32    }
33
34    pub fn verbose_logging(mut self, verbose: bool) -> Self {
35        self.verbose_logging = verbose;
36        self
37    }
38
39    pub fn buffer_size(mut self, size: usize) -> Self {
40        self.buffer_size = size;
41        self
42    }
43}
44
45/// Internal export mode derived from options
46#[derive(Debug, Clone, Copy)]
47pub enum ExportMode {
48    UserFocused,
49    Complete,
50}