pub trait Storage {
// Required methods
fn get_string(&self, key: &str) -> Option<String>;
fn set_string(&mut self, key: &str, value: String);
fn flush(&mut self);
}
Expand description
A place where you can store custom data in a way that persists when you restart the app.
On the web this is backed by local storage. On desktop this is backed by the file system.
See CreationContext::storage
and App::save
.
Required Methods§
fn get_string(&self, key: &str) -> Option<String>
fn get_string(&self, key: &str) -> Option<String>
Get the value for the given key.
fn set_string(&mut self, key: &str, value: String)
fn set_string(&mut self, key: &str, value: String)
Set the value for the given key.
fn flush(&mut self)
fn flush(&mut self)
write-to-disk or similar