pub trait SettingsStorage: Send + Sync {
// Required method
fn with_lock(
&mut self,
scope: SettingsScope,
f: &mut dyn FnMut(Option<String>) -> Result<Option<String>, String>,
) -> Result<(), String>;
}Expand description
Storage backend for settings documents.
Ports the TypeScript SettingsStorage interface: with_lock hands the
current raw document text (or None when the file does not exist) to f;
the callback returns the next text to persist, or Ok(None) to perform no
write. A callback Err aborts without writing.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".