ExportBehavior

Trait ExportBehavior 

Source
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§

Source

fn get_data_provider(&self) -> Option<Box<dyn DataProvider>>

Source

fn handle_export_result(&mut self, result: Result<String>)

Handle export result with status message

Provided Methods§

Source

fn export_to_csv(&mut self) -> Result<String>

Export current data to CSV file

Source

fn export_to_json(&mut self) -> Result<String>

Export current data to JSON file

Source

fn export_to_format(&mut self, format: ExportFormat) -> Result<String>

Export current data to a custom format

Source

fn export_selection_to_csv(&mut self) -> Result<String>

Export selected rows to CSV

Source

fn export_selection_to_json(&mut self) -> Result<String>

Export selected rows to JSON

Source

fn get_export_filename(&self, extension: &str) -> String

Get export filename with timestamp

Implementors§