Struct Builder

Source
pub struct Builder<R: Runtime> { /* private fields */ }
Expand description

Builder for the Vue plugin.

Implementations§

Source§

impl<R: Runtime> Builder<R>

Source

pub fn new() -> Self

Creates a new builder instance with default values.

Source

pub fn autosave(self, interval: Duration) -> Self

Sets the autosave interval for all stores.

Source

pub fn default_save_strategy(self, strategy: SaveStrategy) -> Self

Sets the default save strategy to be used by the stores.

Source

pub fn on_load<F>(self, f: F) -> Self
where F: Fn(&Store<R, VueMarker>) -> Result<()> + Send + Sync + 'static,

Registers a closure to be called when a store is loaded.

Source

pub fn path(self, path: impl AsRef<Path>) -> Self

Directory where the stores will be saved.

Source

pub fn pretty(self, yes: bool) -> Self

Sets whether the store files should be pretty printed.

Source

pub fn save_denylist<I, T>(self, denylist: I) -> Self
where I: IntoIterator<Item = T>, T: AsRef<str>,

Sets a list of stores that should not be saved to disk.

Source

pub fn sync_denylist<I, T>(self, denylist: I) -> Self
where I: IntoIterator<Item = T>, T: AsRef<str>,

Sets a list of stores that should not be synchronized across windows.

Source

pub fn migration(self, id: impl Into<StoreId>, migration: Migration) -> Self

Available on crate feature unstable-migration only.

Defines a migration for a store.

Source

pub fn migrations<I>(self, id: impl Into<StoreId>, migrations: I) -> Self
where I: IntoIterator<Item = Migration>,

Available on crate feature unstable-migration only.

Defines multiple migrations for a store.

Source

pub fn on_before_each_migration<F>(self, f: F) -> Self
where F: Fn(MigrationContext<'_>) + Send + Sync + 'static,

Available on crate feature unstable-migration only.

Sets a closure to be called before each migration step.

Source§

impl<R: Runtime> Builder<R>

Source

pub fn build(self) -> TauriPlugin<R>

Builds the Vue plugin.

Trait Implementations§

Source§

impl<R: Runtime> Default for Builder<R>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,