Struct dioxus_signals::SetCompare
source · pub struct SetCompare<R: 'static, S: Storage<SignalData<bool>> = UnsyncStorage> { /* private fields */ }Expand description
An object that can efficiently compare a value to a set of values.
Implementations§
source§impl<R: Eq + Hash> SetCompare<R>
impl<R: Eq + Hash> SetCompare<R>
sourcepub fn new(f: impl FnMut() -> R + 'static) -> SetCompare<R>
pub fn new(f: impl FnMut() -> R + 'static) -> SetCompare<R>
Creates a new SetCompare which efficiently tracks when a value changes to check if it is equal to a set of values.
Generally, you shouldn’t need to use this hook. Instead you can use [crate::use_memo]. If you have many values that you need to compare to a single value, this hook will change updates from O(n) to O(1) where n is the number of values you are comparing to.
source§impl<R: Eq + Hash, S: Storage<SignalData<bool>>> SetCompare<R, S>
impl<R: Eq + Hash, S: Storage<SignalData<bool>>> SetCompare<R, S>
sourcepub fn new_maybe_sync(f: impl FnMut() -> R + 'static) -> SetCompare<R>
pub fn new_maybe_sync(f: impl FnMut() -> R + 'static) -> SetCompare<R>
Creates a new SetCompare that may be Sync + Send which efficiently tracks when a value changes to check if it is equal to a set of values.
Generally, you shouldn’t need to use this hook. Instead you can use [crate::use_memo]. If you have many values that you need to compare to a single value, this hook will change updates from O(n) to O(1) where n is the number of values you are comparing to.
sourcepub fn equal(&mut self, value: R) -> ReadOnlySignal<bool, S>
pub fn equal(&mut self, value: R) -> ReadOnlySignal<bool, S>
Returns a signal which is true when the value is equal to the value passed to this function.
Trait Implementations§
source§impl<R, S: Storage<SignalData<bool>>> Clone for SetCompare<R, S>
impl<R, S: Storage<SignalData<bool>>> Clone for SetCompare<R, S>
source§impl<R: Debug + 'static, S: Debug + Storage<SignalData<bool>>> Debug for SetCompare<R, S>
impl<R: Debug + 'static, S: Debug + Storage<SignalData<bool>>> Debug for SetCompare<R, S>
source§impl<R: 'static, S: Storage<SignalData<bool>>> PartialEq for SetCompare<R, S>
impl<R: 'static, S: Storage<SignalData<bool>>> PartialEq for SetCompare<R, S>
impl<R, S: Storage<SignalData<bool>>> Copy for SetCompare<R, S>
Auto Trait Implementations§
impl<R, S> Freeze for SetCompare<R, S>
impl<R, S = UnsyncStorage> !RefUnwindSafe for SetCompare<R, S>
impl<R, S = UnsyncStorage> !Send for SetCompare<R, S>
impl<R, S = UnsyncStorage> !Sync for SetCompare<R, S>
impl<R, S> Unpin for SetCompare<R, S>where
R: Unpin,
impl<R, S = UnsyncStorage> !UnwindSafe for SetCompare<R, S>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)