pub trait Storage: Send + Sync {
// Required methods
fn load(&self) -> Result<Config, Error>;
fn save(&self, config: &Config) -> Result<(), Error>;
fn init(&self) -> Result<(), Error>;
fn backend_name(&self) -> &str;
// Provided method
fn path(&self) -> Option<&Path> { ... }
}Expand description
Backend-agnostic storage for link data.
Operates on Config as a whole — fine-grained CRUD can be added
as default methods later.
Required Methods§
Sourcefn save(&self, config: &Config) -> Result<(), Error>
fn save(&self, config: &Config) -> Result<(), Error>
Save the full config, replacing whatever was stored.
Sourcefn backend_name(&self) -> &str
fn backend_name(&self) -> &str
Human-readable backend name (“toml”, “database”, etc).