#[non_exhaustive]pub enum SaveStrategy {
Immediate,
Debounce(Duration),
Throttle(Duration),
}
Expand description
The strategy to use when saving a store.
For a detailed explanation of the differences between debouncing and throttling, take a look at this article.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Source§impl SaveStrategy
impl SaveStrategy
Sourcepub const fn debounce_millis(millis: u64) -> SaveStrategy
pub const fn debounce_millis(millis: u64) -> SaveStrategy
Returns Debounce
with the given duration, in milliseconds.
Sourcepub const fn debounce_secs(secs: u64) -> SaveStrategy
pub const fn debounce_secs(secs: u64) -> SaveStrategy
Returns Debounce
with the given duration, in seconds.
Sourcepub const fn throttle_millis(millis: u64) -> SaveStrategy
pub const fn throttle_millis(millis: u64) -> SaveStrategy
Returns Throttle
with the given duration, in milliseconds.
Sourcepub const fn throttle_secs(secs: u64) -> SaveStrategy
pub const fn throttle_secs(secs: u64) -> SaveStrategy
Returns Throttle
with the given duration, in seconds.
Sourcepub const fn is_debounce(&self) -> bool
pub const fn is_debounce(&self) -> bool
Whether the strategy is Debounce
.
Sourcepub const fn is_throttle(&self) -> bool
pub const fn is_throttle(&self) -> bool
Whether the strategy is Throttle
.
Trait Implementations§
Source§impl Clone for SaveStrategy
impl Clone for SaveStrategy
Source§fn clone(&self) -> SaveStrategy
fn clone(&self) -> SaveStrategy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SaveStrategy
impl Debug for SaveStrategy
Source§impl Default for SaveStrategy
impl Default for SaveStrategy
Source§fn default() -> SaveStrategy
fn default() -> SaveStrategy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SaveStrategy
impl<'de> Deserialize<'de> for SaveStrategy
Source§fn deserialize<D>(
deserializer: D,
) -> Result<SaveStrategy, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<SaveStrategy, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for SaveStrategy
impl Display for SaveStrategy
Source§impl Serialize for SaveStrategy
impl Serialize for SaveStrategy
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for SaveStrategy
Auto Trait Implementations§
impl Freeze for SaveStrategy
impl RefUnwindSafe for SaveStrategy
impl Send for SaveStrategy
impl Sync for SaveStrategy
impl Unpin for SaveStrategy
impl UnwindSafe for SaveStrategy
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
Source§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
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