Struct tauri_plugin_store::Builder
source · pub struct Builder<R: Runtime> { /* private fields */ }
Implementations§
source§impl<R: Runtime> Builder<R>
impl<R: Runtime> Builder<R>
pub fn new() -> Self
sourcepub fn store(self, store: Store<R>) -> Self
pub fn store(self, store: Store<R>) -> Self
Registers a store with the plugin.
§Examples
use tauri_plugin_store::{StoreBuilder, Builder};
tauri::Builder::default()
.setup(|app| {
let store = StoreBuilder::new("store.bin").build(app.handle().clone());
let builder = Builder::default().store(store);
Ok(())
});
sourcepub fn stores<T: IntoIterator<Item = Store<R>>>(self, stores: T) -> Self
pub fn stores<T: IntoIterator<Item = Store<R>>>(self, stores: T) -> Self
Registers multiple stores with the plugin.
§Examples
use tauri_plugin_store::{StoreBuilder, Builder};
tauri::Builder::default()
.setup(|app| {
let store = StoreBuilder::new("store.bin").build(app.handle().clone());
let builder = Builder::default().stores([store]);
Ok(())
});
sourcepub fn freeze(self) -> Self
pub fn freeze(self) -> Self
Freezes the collection.
This causes requests for plugins that haven’t been registered to fail
§Examples
use tauri_plugin_store::{StoreBuilder, Builder};
tauri::Builder::default()
.setup(|app| {
let store = StoreBuilder::new("store.bin").build(app.handle().clone());
app.handle().plugin(Builder::default().freeze().build());
Ok(())
});
sourcepub fn build(self) -> TauriPlugin<R>
pub fn build(self) -> TauriPlugin<R>
Builds the plugin.
§Examples
use tauri_plugin_store::{StoreBuilder, Builder};
tauri::Builder::default()
.setup(|app| {
let store = StoreBuilder::new("store.bin").build(app.handle().clone());
app.handle().plugin(Builder::default().build());
Ok(())
});
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for Builder<R>
impl<R> !RefUnwindSafe for Builder<R>
impl<R> Send for Builder<R>
impl<R> Sync for Builder<R>
impl<R> Unpin for Builder<R>
impl<R> !UnwindSafe for Builder<R>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more