rename newOrExisting to load, load to reload

pull/1860/head
Lucas Nogueira 9 months ago
parent 44016a480f
commit 983bd82212
No known key found for this signature in database
GPG Key ID: 7C32FCA95C8C95D7

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_STORE__=function(t){"use strict";var e,a;function r(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}async function s(t,e={},a){return window.__TAURI_INTERNALS__.invoke(t,e,a)}"function"==typeof SuppressedError&&SuppressedError;class i{get rid(){return function(t,e,a,r){if("a"===a&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===a?r:"a"===a?r.call(t):r?r.value:e.get(t)}(this,e,"f")}constructor(t){e.set(this,void 0),function(t,e,a,r,s){if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,a)}(this,e,t)}async close(){return s("plugin:resources|close",{rid:this.rid})}}async function n(t,e,a){const i={kind:"Any"};return s("plugin:event|listen",{event:t,target:i,handler:r(e)}).then((e=>async()=>async function(t,e){await s("plugin:event|unlisten",{event:t,eventId:e})}(t,e)))}async function o(t,e){return await c.newOrExisting(t,e)}e=new WeakMap,function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_CREATED="tauri://window-created",t.WEBVIEW_CREATED="tauri://webview-created",t.DRAG_ENTER="tauri://drag-enter",t.DRAG_OVER="tauri://drag-over",t.DRAG_DROP="tauri://drag-drop",t.DRAG_LEAVE="tauri://drag-leave"}(a||(a={}));class c extends i{constructor(t){super(t)}static async create(t,e){const a=await s("plugin:store|create_store",{path:t,...e});return new c(a)}static async newOrExisting(t,e){const a=await s("plugin:store|new_or_existing",{path:t,...e});return new c(a)}static async get(t){return await s("plugin:store|get_store",{path:t}).then((t=>t?new c(t):null))}async set(t,e){await s("plugin:store|set",{rid:this.rid,key:t,value:e})}async get(t){const[e,a]=await s("plugin:store|get",{rid:this.rid,key:t});return a?e:void 0}async has(t){return await s("plugin:store|has",{rid:this.rid,key:t})}async delete(t){return await s("plugin:store|delete",{rid:this.rid,key:t})}async clear(){await s("plugin:store|clear",{rid:this.rid})}async reset(){await s("plugin:store|reset",{rid:this.rid})}async keys(){return await s("plugin:store|keys",{rid:this.rid})}async values(){return await s("plugin:store|values",{rid:this.rid})}async entries(){return await s("plugin:store|entries",{rid:this.rid})}async length(){return await s("plugin:store|length",{rid:this.rid})}async load(){await s("plugin:store|load",{rid:this.rid})}async save(){await s("plugin:store|save",{rid:this.rid})}async onKeyChange(t,e){return await n("store://change",(a=>{a.payload.resourceId===this.rid&&a.payload.key===t&&e(a.payload.exists?a.payload.value:void 0)}))}async onChange(t){return await n("store://change",(e=>{e.payload.resourceId===this.rid&&t(e.payload.key,e.payload.exists?e.payload.value:void 0)}))}async close(){await s("plugin:store|close_store",{rid:this.rid})}}return t.LazyStore=class{get store(){return this._store||(this._store=o(this.path,this.options)),this._store}constructor(t,e){this.path=t,this.options=e}async init(){await this.store}async set(t,e){return(await this.store).set(t,e)}async get(t){return(await this.store).get(t)}async has(t){return(await this.store).has(t)}async delete(t){return(await this.store).delete(t)}async clear(){await(await this.store).clear()}async reset(){await(await this.store).reset()}async keys(){return(await this.store).keys()}async values(){return(await this.store).values()}async entries(){return(await this.store).entries()}async length(){return(await this.store).length()}async load(){await(await this.store).load()}async save(){await(await this.store).save()}async onKeyChange(t,e){return(await this.store).onKeyChange(t,e)}async onChange(t){return(await this.store).onChange(t)}async close(){this._store&&await(await this._store).close()}},t.Store=c,t.create=async function(t,e){return await c.create(t,e)},t.getStore=async function(t){return await c.get(t)},t.newOrExisting=o,t}({});Object.defineProperty(window.__TAURI__,"store",{value:__TAURI_PLUGIN_STORE__})} if("__TAURI__"in window){var __TAURI_PLUGIN_STORE__=function(t){"use strict";var e,a;function r(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}async function s(t,e={},a){return window.__TAURI_INTERNALS__.invoke(t,e,a)}"function"==typeof SuppressedError&&SuppressedError;class i{get rid(){return function(t,e,a,r){if("a"===a&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===a?r:"a"===a?r.call(t):r?r.value:e.get(t)}(this,e,"f")}constructor(t){e.set(this,void 0),function(t,e,a,r,s){if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,a)}(this,e,t)}async close(){return s("plugin:resources|close",{rid:this.rid})}}async function n(t,e,a){const i={kind:"Any"};return s("plugin:event|listen",{event:t,target:i,handler:r(e)}).then((e=>async()=>async function(t,e){await s("plugin:event|unlisten",{event:t,eventId:e})}(t,e)))}async function o(t,e){return await c.load(t,e)}e=new WeakMap,function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_CREATED="tauri://window-created",t.WEBVIEW_CREATED="tauri://webview-created",t.DRAG_ENTER="tauri://drag-enter",t.DRAG_OVER="tauri://drag-over",t.DRAG_DROP="tauri://drag-drop",t.DRAG_LEAVE="tauri://drag-leave"}(a||(a={}));class c extends i{constructor(t){super(t)}static async create(t,e){const a=await s("plugin:store|create_store",{path:t,...e});return new c(a)}static async load(t,e){const a=await s("plugin:store|load",{path:t,...e});return new c(a)}static async get(t){return await s("plugin:store|get_store",{path:t}).then((t=>t?new c(t):null))}async set(t,e){await s("plugin:store|set",{rid:this.rid,key:t,value:e})}async get(t){const[e,a]=await s("plugin:store|get",{rid:this.rid,key:t});return a?e:void 0}async has(t){return await s("plugin:store|has",{rid:this.rid,key:t})}async delete(t){return await s("plugin:store|delete",{rid:this.rid,key:t})}async clear(){await s("plugin:store|clear",{rid:this.rid})}async reset(){await s("plugin:store|reset",{rid:this.rid})}async keys(){return await s("plugin:store|keys",{rid:this.rid})}async values(){return await s("plugin:store|values",{rid:this.rid})}async entries(){return await s("plugin:store|entries",{rid:this.rid})}async length(){return await s("plugin:store|length",{rid:this.rid})}async load(){await s("plugin:store|load",{rid:this.rid})}async save(){await s("plugin:store|save",{rid:this.rid})}async onKeyChange(t,e){return await n("store://change",(a=>{a.payload.resourceId===this.rid&&a.payload.key===t&&e(a.payload.exists?a.payload.value:void 0)}))}async onChange(t){return await n("store://change",(e=>{e.payload.resourceId===this.rid&&t(e.payload.key,e.payload.exists?e.payload.value:void 0)}))}async close(){await s("plugin:store|close_store",{rid:this.rid})}}return t.LazyStore=class{get store(){return this._store||(this._store=o(this.path,this.options)),this._store}constructor(t,e){this.path=t,this.options=e}async init(){await this.store}async set(t,e){return(await this.store).set(t,e)}async get(t){return(await this.store).get(t)}async has(t){return(await this.store).has(t)}async delete(t){return(await this.store).delete(t)}async clear(){await(await this.store).clear()}async reset(){await(await this.store).reset()}async keys(){return(await this.store).keys()}async values(){return(await this.store).values()}async entries(){return(await this.store).entries()}async length(){return(await this.store).length()}async load(){await(await this.store).load()}async save(){await(await this.store).save()}async onKeyChange(t,e){return(await this.store).onKeyChange(t,e)}async onChange(t){return(await this.store).onChange(t)}async close(){this._store&&await(await this._store).close()}},t.Store=c,t.create=async function(t,e){return await c.create(t,e)},t.getStore=async function(t){return await c.get(t)},t.load=o,t}({});Object.defineProperty(window.__TAURI__,"store",{value:__TAURI_PLUGIN_STORE__})}

@ -4,7 +4,7 @@
const COMMANDS: &[&str] = &[ const COMMANDS: &[&str] = &[
"create_store", "create_store",
"new_or_existing", "load",
"get_store", "get_store",
"close_store", "close_store",
"set", "set",
@ -17,7 +17,7 @@ const COMMANDS: &[&str] = &[
"values", "values",
"entries", "entries",
"length", "length",
"load", "reload",
"save", "save",
]; ];

@ -55,11 +55,11 @@ export async function create(
* @param path Path to save the store in `app_data_dir` * @param path Path to save the store in `app_data_dir`
* @param options Store configuration options * @param options Store configuration options
*/ */
export async function newOrExisting( export async function load(
path: string, path: string,
options?: StoreOptions options?: StoreOptions
): Promise<Store> { ): Promise<Store> {
return await Store.newOrExisting(path, options) return await Store.load(path, options)
} }
/** /**
@ -77,7 +77,7 @@ export class LazyStore implements IStore {
private get store(): Promise<Store> { private get store(): Promise<Store> {
if (!this._store) { if (!this._store) {
this._store = newOrExisting(this.path, this.options) this._store = load(this.path, this.options)
} }
return this._store return this._store
} }
@ -180,6 +180,8 @@ export class Store extends Resource implements IStore {
* *
* If the store already exists, its data will be overwritten. * If the store already exists, its data will be overwritten.
* *
* To load the store if it already exists you must use {@link load} instead.
*
* If the store is already loaded you must use {@link getStore} instead. * If the store is already loaded you must use {@link getStore} instead.
* *
* @example * @example
@ -211,18 +213,15 @@ export class Store extends Resource implements IStore {
* import { Store } from '@tauri-apps/api/store'; * import { Store } from '@tauri-apps/api/store';
* let store = await Store.get('store.json'); * let store = await Store.get('store.json');
* if (!store) { * if (!store) {
* store = await Store.newOrExisting('store.json'); * store = await Store.load('store.json');
* } * }
* ``` * ```
* *
* @param path Path to save the store in `app_data_dir` * @param path Path to save the store in `app_data_dir`
* @param options Store configuration options * @param options Store configuration options
*/ */
static async newOrExisting( static async load(path: string, options?: StoreOptions): Promise<Store> {
path: string, const rid = await invoke<number>('plugin:store|load', {
options?: StoreOptions
): Promise<Store> {
const rid = await invoke<number>('plugin:store|new_or_existing', {
path, path,
...options ...options
}) })
@ -233,14 +232,14 @@ export class Store extends Resource implements IStore {
* Gets an already loaded store. * Gets an already loaded store.
* *
* If the store is not loaded, returns `null`. In this case, * If the store is not loaded, returns `null`. In this case,
* you must either {@link Store.create | create} it or {@link Store.newOrExisting newOrExisting} it. * you must either {@link Store.create | create} it or {@link Store.load load} it.
* *
* @example * @example
* ```typescript * ```typescript
* import { Store } from '@tauri-apps/api/store'; * import { Store } from '@tauri-apps/api/store';
* let store = await Store.get('store.json'); * let store = await Store.get('store.json');
* if (!store) { * if (!store) {
* store = await Store.newOrExisting('store.json'); * store = await Store.load('store.json');
* } * }
* ``` * ```
* *
@ -306,8 +305,8 @@ export class Store extends Resource implements IStore {
return await invoke('plugin:store|length', { rid: this.rid }) return await invoke('plugin:store|length', { rid: this.rid })
} }
async load(): Promise<void> { async reload(): Promise<void> {
await invoke('plugin:store|load', { rid: this.rid }) await invoke('plugin:store|reload', { rid: this.rid })
} }
async save(): Promise<void> { async save(): Promise<void> {

@ -1,13 +0,0 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-new-or-existing"
description = "Enables the new_or_existing command without any pre-configured scope."
commands.allow = ["new_or_existing"]
[[permission]]
identifier = "deny-new-or-existing"
description = "Denies the new_or_existing command without any pre-configured scope."
commands.deny = ["new_or_existing"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-reload"
description = "Enables the reload command without any pre-configured scope."
commands.allow = ["reload"]
[[permission]]
identifier = "deny-reload"
description = "Denies the reload command without any pre-configured scope."
commands.deny = ["reload"]

@ -10,7 +10,7 @@ All operations are enabled by default.
- `allow-create-store` - `allow-create-store`
- `allow-new-or-existing` - `allow-load`
- `allow-get-store` - `allow-get-store`
- `allow-close-store` - `allow-close-store`
- `allow-set` - `allow-set`
@ -324,12 +324,12 @@ Denies the load command without any pre-configured scope.
<tr> <tr>
<td> <td>
`store:allow-new-or-existing` `store:allow-reload`
</td> </td>
<td> <td>
Enables the new_or_existing command without any pre-configured scope. Enables the reload command without any pre-configured scope.
</td> </td>
</tr> </tr>
@ -337,12 +337,12 @@ Enables the new_or_existing command without any pre-configured scope.
<tr> <tr>
<td> <td>
`store:deny-new-or-existing` `store:deny-reload`
</td> </td>
<td> <td>
Denies the new_or_existing command without any pre-configured scope. Denies the reload command without any pre-configured scope.
</td> </td>
</tr> </tr>

@ -12,7 +12,7 @@ All operations are enabled by default.
""" """
permissions = [ permissions = [
"allow-create-store", "allow-create-store",
"allow-new-or-existing", "allow-load",
"allow-get-store", "allow-get-store",
"allow-close-store", "allow-close-store",
"allow-set", "allow-set",

@ -405,14 +405,14 @@
"const": "deny-load" "const": "deny-load"
}, },
{ {
"description": "Enables the new_or_existing command without any pre-configured scope.", "description": "Enables the reload command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "allow-new-or-existing" "const": "allow-reload"
}, },
{ {
"description": "Denies the new_or_existing command without any pre-configured scope.", "description": "Denies the reload command without any pre-configured scope.",
"type": "string", "type": "string",
"const": "deny-new-or-existing" "const": "deny-reload"
}, },
{ {
"description": "Enables the reset command without any pre-configured scope.", "description": "Enables the reset command without any pre-configured scope.",

@ -116,7 +116,7 @@ async fn create_store<R: Runtime>(
} }
#[tauri::command] #[tauri::command]
async fn new_or_existing<R: Runtime>( async fn load<R: Runtime>(
app: AppHandle<R>, app: AppHandle<R>,
store_state: State<'_, StoreState>, store_state: State<'_, StoreState>,
path: PathBuf, path: PathBuf,
@ -132,7 +132,7 @@ async fn new_or_existing<R: Runtime>(
serialize_fn_name, serialize_fn_name,
deserialize_fn_name, deserialize_fn_name,
)?; )?;
let (_, rid) = builder.new_or_existing_inner()?; let (_, rid) = builder.load_inner()?;
Ok(rid) Ok(rid)
} }
@ -229,9 +229,9 @@ async fn length<R: Runtime>(app: AppHandle<R>, rid: ResourceId) -> Result<usize>
} }
#[tauri::command] #[tauri::command]
async fn load<R: Runtime>(app: AppHandle<R>, rid: ResourceId) -> Result<()> { async fn reload<R: Runtime>(app: AppHandle<R>, rid: ResourceId) -> Result<()> {
let store = app.resources_table().get::<Store<R>>(rid)?; let store = app.resources_table().get::<Store<R>>(rid)?;
store.load() store.reload()
} }
#[tauri::command] #[tauri::command]
@ -290,7 +290,7 @@ pub trait StoreExt<R: Runtime> {
/// tauri::Builder::default() /// tauri::Builder::default()
/// .plugin(tauri_plugin_store::Builder::default().build()) /// .plugin(tauri_plugin_store::Builder::default().build())
/// .setup(|app| { /// .setup(|app| {
/// let store = app.store_builder("users.json").auto_save(Duration::from_secs(1)).new_or_existing()?; /// let store = app.store_builder("users.json").auto_save(Duration::from_secs(1)).load()?;
/// Ok(()) /// Ok(())
/// }); /// });
/// ``` /// ```
@ -326,7 +326,7 @@ pub trait StoreExt<R: Runtime> {
impl<R: Runtime, T: Manager<R>> StoreExt<R> for T { impl<R: Runtime, T: Manager<R>> StoreExt<R> for T {
fn store(&self, path: impl AsRef<Path>) -> Result<Arc<Store<R>>> { fn store(&self, path: impl AsRef<Path>) -> Result<Arc<Store<R>>> {
StoreBuilder::new(self.app_handle(), path).new_or_existing() StoreBuilder::new(self.app_handle(), path).load()
} }
fn create_store(&self, path: impl AsRef<Path>) -> Result<Arc<Store<R>>> { fn create_store(&self, path: impl AsRef<Path>) -> Result<Arc<Store<R>>> {
@ -447,7 +447,7 @@ impl Builder {
/// tauri::Builder::default() /// tauri::Builder::default()
/// .plugin(tauri_plugin_store::Builder::default().build()) /// .plugin(tauri_plugin_store::Builder::default().build())
/// .setup(|app| { /// .setup(|app| {
/// let store = tauri_plugin_store::StoreBuilder::new(app, "store.bin").new_or_existing()?; /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.bin").load()?;
/// Ok(()) /// Ok(())
/// }); /// });
/// ``` /// ```
@ -455,7 +455,7 @@ impl Builder {
plugin::Builder::new("store") plugin::Builder::new("store")
.invoke_handler(tauri::generate_handler![ .invoke_handler(tauri::generate_handler![
create_store, create_store,
new_or_existing, load,
get_store, get_store,
close_store, close_store,
set, set,
@ -468,7 +468,7 @@ impl Builder {
values, values,
length, length,
entries, entries,
load, reload,
save, save,
]) ])
.setup(move |app_handle, _api| { .setup(move |app_handle, _api| {

@ -79,7 +79,7 @@ impl<R: Runtime> StoreBuilder<R> {
/// ///
/// let store = tauri_plugin_store::StoreBuilder::new(app, "store.bin") /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.bin")
/// .defaults(defaults) /// .defaults(defaults)
/// .new_or_existing()?; /// .load()?;
/// Ok(()) /// Ok(())
/// }); /// });
/// ``` /// ```
@ -97,7 +97,7 @@ impl<R: Runtime> StoreBuilder<R> {
/// .setup(|app| { /// .setup(|app| {
/// let store = tauri_plugin_store::StoreBuilder::new(app, "store.bin") /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.bin")
/// .default("foo".to_string(), "bar") /// .default("foo".to_string(), "bar")
/// .new_or_existing()?; /// .load()?;
/// Ok(()) /// Ok(())
/// }); /// });
/// ``` /// ```
@ -119,7 +119,7 @@ impl<R: Runtime> StoreBuilder<R> {
/// .setup(|app| { /// .setup(|app| {
/// let store = tauri_plugin_store::StoreBuilder::new(app, "store.json") /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.json")
/// .serialize(|cache| serde_json::to_vec(&cache).map_err(Into::into)) /// .serialize(|cache| serde_json::to_vec(&cache).map_err(Into::into))
/// .new_or_existing()?; /// .load()?;
/// Ok(()) /// Ok(())
/// }); /// });
/// ``` /// ```
@ -137,7 +137,7 @@ impl<R: Runtime> StoreBuilder<R> {
/// .setup(|app| { /// .setup(|app| {
/// let store = tauri_plugin_store::StoreBuilder::new(app, "store.json") /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.json")
/// .deserialize(|bytes| serde_json::from_slice(&bytes).map_err(Into::into)) /// .deserialize(|bytes| serde_json::from_slice(&bytes).map_err(Into::into))
/// .new_or_existing()?; /// .load()?;
/// Ok(()) /// Ok(())
/// }); /// });
/// ``` /// ```
@ -155,7 +155,7 @@ impl<R: Runtime> StoreBuilder<R> {
/// .setup(|app| { /// .setup(|app| {
/// let store = tauri_plugin_store::StoreBuilder::new(app, "store.json") /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.json")
/// .auto_save(std::time::Duration::from_millis(100)) /// .auto_save(std::time::Duration::from_millis(100))
/// .new_or_existing()?; /// .load()?;
/// Ok(()) /// Ok(())
/// }); /// });
/// ``` /// ```
@ -215,7 +215,7 @@ impl<R: Runtime> StoreBuilder<R> {
/// tauri::Builder::default() /// tauri::Builder::default()
/// .plugin(tauri_plugin_store::Builder::default().build()) /// .plugin(tauri_plugin_store::Builder::default().build())
/// .setup(|app| { /// .setup(|app| {
/// let store = tauri_plugin_store::StoreBuilder::new(app, "store.json").new_or_existing()?; /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.json").load()?;
/// Ok(()) /// Ok(())
/// }); /// });
/// ``` /// ```
@ -240,16 +240,16 @@ impl<R: Runtime> StoreBuilder<R> {
/// tauri::Builder::default() /// tauri::Builder::default()
/// .plugin(tauri_plugin_store::Builder::default().build()) /// .plugin(tauri_plugin_store::Builder::default().build())
/// .setup(|app| { /// .setup(|app| {
/// let store = tauri_plugin_store::StoreBuilder::new(app, "store.json").new_or_existing(); /// let store = tauri_plugin_store::StoreBuilder::new(app, "store.json").load();
/// Ok(()) /// Ok(())
/// }); /// });
/// ``` /// ```
pub fn new_or_existing(self) -> crate::Result<Arc<Store<R>>> { pub fn load(self) -> crate::Result<Arc<Store<R>>> {
let (store, _) = self.new_or_existing_inner()?; let (store, _) = self.load_inner()?;
Ok(store) Ok(store)
} }
pub(crate) fn new_or_existing_inner(self) -> crate::Result<(Arc<Store<R>>, ResourceId)> { pub(crate) fn load_inner(self) -> crate::Result<(Arc<Store<R>>, ResourceId)> {
let stores = self.app.state::<StoreState>().stores.clone(); let stores = self.app.state::<StoreState>().stores.clone();
let stores_ = stores.lock().unwrap(); let stores_ = stores.lock().unwrap();
if let Some(rid) = stores_.get(&self.path) { if let Some(rid) = stores_.get(&self.path) {
@ -519,7 +519,7 @@ impl<R: Runtime> Store<R> {
} }
/// Update the store from the on-disk state /// Update the store from the on-disk state
pub fn load(&self) -> crate::Result<()> { pub fn reload(&self) -> crate::Result<()> {
self.store.lock().unwrap().load() self.store.lock().unwrap().load()
} }

Loading…
Cancel
Save