pub struct UseStorageOptions<T, E, D>{ /* private fields */ }Expand description
Implementations§
Source§impl<T, E, D> UseStorageOptions<T, E, D>
impl<T, E, D> UseStorageOptions<T, E, D>
pub fn listen_to_storage_changes(self, value: bool) -> Self
pub fn filter(self, value: impl Into<FilterOptions>) -> Self
Sourcepub fn delay_during_hydration(self, value: bool) -> Self
pub fn delay_during_hydration(self, value: bool) -> Self
Delays the reading of the value from storage by one animation frame during hydration.
This ensures that during hydration the value is the initial value just like it is on the server
which helps prevent hydration errors. Defaults to false.
Source§impl<T, E, D> UseStorageOptions<T, E, D>
impl<T, E, D> UseStorageOptions<T, E, D>
Sourcepub fn on_error(
self,
on_error: impl Fn(UseStorageError<E, D>) + Send + Sync + 'static,
) -> Self
pub fn on_error( self, on_error: impl Fn(UseStorageError<E, D>) + Send + Sync + 'static, ) -> Self
Optional callback whenever an error occurs.
Sourcepub fn initial_value(self, initial: impl Into<MaybeRwSignal<T>>) -> Self
pub fn initial_value(self, initial: impl Into<MaybeRwSignal<T>>) -> Self
Initial value to use when the storage key is not set. Note that this value is read once on creation of the storage hook and not updated again. Accepts a signal and defaults to T::default().
Trait Implementations§
Auto Trait Implementations§
impl<T, E, D> Freeze for UseStorageOptions<T, E, D>where
T: Freeze,
impl<T, E, D> !RefUnwindSafe for UseStorageOptions<T, E, D>
impl<T, E, D> Send for UseStorageOptions<T, E, D>
impl<T, E, D> Sync for UseStorageOptions<T, E, D>
impl<T, E, D> Unpin for UseStorageOptions<T, E, D>where
T: Unpin,
impl<T, E, D> UnsafeUnpin for UseStorageOptions<T, E, D>where
T: UnsafeUnpin,
impl<T, E, D> !UnwindSafe for UseStorageOptions<T, E, D>
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 moreSource§impl<El, T, Marker> IntoElementMaybeSignal<T, Marker> for Elwhere
El: IntoElementMaybeSignalType<T, Marker>,
impl<El, T, Marker> IntoElementMaybeSignal<T, Marker> for Elwhere
El: IntoElementMaybeSignalType<T, Marker>,
fn into_element_maybe_signal(self) -> ElementMaybeSignal<T>
Source§impl<T, Js> IntoElementMaybeSignalType<T, Element> for Js
impl<T, Js> IntoElementMaybeSignalType<T, Element> for Js
fn into_element_maybe_signal_type(self) -> ElementMaybeSignalType<T>
Source§impl<El, T, Marker> IntoElementsMaybeSignal<T, Marker> for Elwhere
El: IntoElementsMaybeSignalType<T, Marker>,
impl<El, T, Marker> IntoElementsMaybeSignal<T, Marker> for Elwhere
El: IntoElementsMaybeSignalType<T, Marker>,
fn into_elements_maybe_signal(self) -> ElementsMaybeSignal<T>
Source§impl<T, Js> IntoElementsMaybeSignalType<T, Element> for Js
impl<T, Js> IntoElementsMaybeSignalType<T, Element> for Js
fn into_elements_maybe_signal_type(self) -> ElementsMaybeSignalType<T>
Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.