pub struct Builder<R: Runtime> { /* private fields */ }
Expand description
Builder for the Svelte plugin.
Implementations§
Source§impl<R: Runtime> Builder<R>
impl<R: Runtime> Builder<R>
Sourcepub fn default_save_strategy(self, strategy: SaveStrategy) -> Self
pub fn default_save_strategy(self, strategy: SaveStrategy) -> Self
Sets the default save strategy to be used by the stores.
Sourcepub fn path(self, path: impl AsRef<Path>) -> Self
pub fn path(self, path: impl AsRef<Path>) -> Self
Default directory where the stores are saved.
Sourcepub fn path_of(self, id: impl AsRef<str>, path: impl AsRef<Path>) -> Self
pub fn path_of(self, id: impl AsRef<str>, path: impl AsRef<Path>) -> Self
Directory where a specific store should be saved.
Sourcepub fn save_denylist<I, T>(self, denylist: I) -> Self
pub fn save_denylist<I, T>(self, denylist: I) -> Self
Sets a list of stores that should not be saved to disk.
Sourcepub fn sync_denylist<I, T>(self, denylist: I) -> Self
pub fn sync_denylist<I, T>(self, denylist: I) -> Self
Sets a list of stores that should not be synchronized across windows.
Sourcepub fn marshaler(self, marshaler: Box<dyn Marshaler>) -> Self
pub fn marshaler(self, marshaler: Box<dyn Marshaler>) -> Self
Defines how the stores should be serialized and deserialized.
Sourcepub fn marshaler_of(
self,
id: impl AsRef<str>,
marshaler: Box<dyn Marshaler>,
) -> Self
pub fn marshaler_of( self, id: impl AsRef<str>, marshaler: Box<dyn Marshaler>, ) -> Self
Defines how a store should be serialized and deserialized.
Sourcepub fn enable_debug_stores(self, yes: bool) -> Self
pub fn enable_debug_stores(self, yes: bool) -> Self
Adds a .dev
suffix to the store files when in development mode.
This is enabled by default.
Sourcepub fn migration(self, id: impl Into<StoreId>, migration: Migration) -> Self
pub fn migration(self, id: impl Into<StoreId>, migration: Migration) -> Self
Defines a migration for a store.
Sourcepub fn migrations<I>(self, id: impl Into<StoreId>, migrations: I) -> Selfwhere
I: IntoIterator<Item = Migration>,
pub fn migrations<I>(self, id: impl Into<StoreId>, migrations: I) -> Selfwhere
I: IntoIterator<Item = Migration>,
Defines multiple migrations for a store.
Sourcepub fn on_before_each_migration<F>(self, f: F) -> Self
pub fn on_before_each_migration<F>(self, f: F) -> Self
Sets a closure to be called before each migration step.
Sourcepub fn build(self) -> TauriPlugin<R>
pub fn build(self) -> TauriPlugin<R>
Builds the Svelte plugin.
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more