pub struct KeyedSignal<Key, Val>{ /* private fields */ }
Expand description
A KeyedSignal associates a key with a value. This is typically used for caching, where a key is needed for searching in the cache.
Only when the key changes, when it’s not equal to previous value, the lookup function is called.
The value needs to implement Default, if it happens to be something that doesn’t have a Default implementation, then wrap it in an Option since it implements a Default value of None.
Implementations§
Trait Implementations§
Source§impl<Key, Val> Clone for KeyedSignal<Key, Val>
impl<Key, Val> Clone for KeyedSignal<Key, Val>
Source§fn clone(&self) -> KeyedSignal<Key, Val>
fn clone(&self) -> KeyedSignal<Key, Val>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<Key, Val> Freeze for KeyedSignal<Key, Val>
impl<Key, Val> !RefUnwindSafe for KeyedSignal<Key, Val>
impl<Key, Val> !Send for KeyedSignal<Key, Val>
impl<Key, Val> !Sync for KeyedSignal<Key, Val>
impl<Key, Val> Unpin for KeyedSignal<Key, Val>
impl<Key, Val> !UnwindSafe for KeyedSignal<Key, Val>
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