pub trait ExportBehavior {
// Required methods
fn get_data_provider(&self) -> Option<Box<dyn DataProvider>>;
fn handle_export_result(&mut self, result: Result<String>);
// Provided methods
fn export_to_csv(&mut self) -> Result<String> { ... }
fn export_to_json(&mut self) -> Result<String> { ... }
fn export_to_format(&mut self, format: ExportFormat) -> Result<String> { ... }
fn export_selection_to_csv(&mut self) -> Result<String> { ... }
fn export_selection_to_json(&mut self) -> Result<String> { ... }
fn get_export_filename(&self, extension: &str) -> String { ... }
}
Expand description
Trait for exporting data to various formats
Required Methods§
fn get_data_provider(&self) -> Option<Box<dyn DataProvider>>
Sourcefn handle_export_result(&mut self, result: Result<String>)
fn handle_export_result(&mut self, result: Result<String>)
Handle export result with status message
Provided Methods§
Sourcefn export_to_csv(&mut self) -> Result<String>
fn export_to_csv(&mut self) -> Result<String>
Export current data to CSV file
Sourcefn export_to_json(&mut self) -> Result<String>
fn export_to_json(&mut self) -> Result<String>
Export current data to JSON file
Sourcefn export_to_format(&mut self, format: ExportFormat) -> Result<String>
fn export_to_format(&mut self, format: ExportFormat) -> Result<String>
Export current data to a custom format
Sourcefn export_selection_to_csv(&mut self) -> Result<String>
fn export_selection_to_csv(&mut self) -> Result<String>
Export selected rows to CSV
Sourcefn export_selection_to_json(&mut self) -> Result<String>
fn export_selection_to_json(&mut self) -> Result<String>
Export selected rows to JSON
Sourcefn get_export_filename(&self, extension: &str) -> String
fn get_export_filename(&self, extension: &str) -> String
Get export filename with timestamp