Skip to main content

rustodo/storage/
mod.rs

1//! Storage abstraction layer for task persistence
2
3use crate::models::Task;
4use anyhow::Result;
5
6/// Trait defining storage operations for tasks
7pub trait Storage {
8    /// Load all tasks from storage
9    fn load(&self) -> Result<Vec<Task>>;
10
11    /// Save all tasks to storage
12    fn save(&self, tasks: &[Task]) -> Result<()>;
13
14    /// Get the storage location description
15    #[allow(dead_code)]
16    fn location(&self) -> String;
17}
18
19// Re-export implementations
20pub mod json;
21pub mod memory;
22
23pub use json::JsonStorage;
24
25// Re-export old functions for backward compatibility (temporary)
26pub use json::get_data_file_path;