mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-20 21:20:42 +02:00
Remove StoreInner from pub and expose is_empty
This commit is contained in:
@@ -21,7 +21,7 @@ use std::{
|
|||||||
sync::{Arc, Mutex},
|
sync::{Arc, Mutex},
|
||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
pub use store::{resolve_store_path, DeserializeFn, SerializeFn, Store, StoreBuilder, StoreInner};
|
pub use store::{resolve_store_path, DeserializeFn, SerializeFn, Store, StoreBuilder};
|
||||||
use tauri::{
|
use tauri::{
|
||||||
plugin::{self, TauriPlugin},
|
plugin::{self, TauriPlugin},
|
||||||
AppHandle, Manager, ResourceId, RunEvent, Runtime, State,
|
AppHandle, Manager, ResourceId, RunEvent, Runtime, State,
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ enum AutoSaveMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct StoreInner<R: Runtime> {
|
struct StoreInner<R: Runtime> {
|
||||||
app: AppHandle<R>,
|
app: AppHandle<R>,
|
||||||
path: PathBuf,
|
path: PathBuf,
|
||||||
cache: HashMap<String, JsonValue>,
|
cache: HashMap<String, JsonValue>,
|
||||||
@@ -515,6 +515,11 @@ impl<R: Runtime> Store<R> {
|
|||||||
self.store.lock().unwrap().len()
|
self.store.lock().unwrap().len()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns true if the store contains no elements.
|
||||||
|
pub fn is_empty(&self) -> bool {
|
||||||
|
self.store.lock().unwrap().is_empty()
|
||||||
|
}
|
||||||
|
|
||||||
/// Update the store from the on-disk state
|
/// Update the store from the on-disk state
|
||||||
pub fn load(&self) -> crate::Result<()> {
|
pub fn load(&self) -> crate::Result<()> {
|
||||||
self.store.lock().unwrap().load()
|
self.store.lock().unwrap().load()
|
||||||
|
|||||||
Reference in New Issue
Block a user