use std::collections::HashMap;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct FormatInfo {
pub name: String,
pub extensions: Vec<String>,
pub mime_type: String,
pub description: String,
pub supports_styling: bool,
pub supports_positioning: bool,
}
#[derive(Debug, Clone)]
pub struct FormatOptions {
pub encoding: String,
pub preserve_formatting: bool,
pub custom_options: HashMap<String, String>,
}
impl Default for FormatOptions {
fn default() -> Self {
Self {
encoding: "UTF-8".to_string(),
preserve_formatting: true,
custom_options: HashMap::new(),
}
}
}
#[derive(Debug)]
pub struct FormatResult {
pub success: bool,
pub lines_processed: usize,
pub warnings: Vec<String>,
pub metadata: HashMap<String, String>,
}
impl FormatResult {
pub fn success(lines_processed: usize) -> Self {
Self {
success: true,
lines_processed,
warnings: Vec::new(),
metadata: HashMap::new(),
}
}
pub fn with_warnings(mut self, warnings: Vec<String>) -> Self {
self.warnings = warnings;
self
}
pub fn with_metadata(mut self, key: String, value: String) -> Self {
self.metadata.insert(key, value);
self
}
}