pub struct Latest<K, V> { /* private fields */ }Expand description
One slow value following a key; see the module.
Implementations§
Source§impl<K, V> Latest<K, V>
impl<K, V> Latest<K, V>
pub fn new() -> Self
Sourcepub fn want(
&mut self,
ctx: &Context,
key: Option<&K>,
load: impl FnOnce(&K, &Cancel) -> V + Send + 'static,
) -> Loaded<'_, V>
pub fn want( &mut self, ctx: &Context, key: Option<&K>, load: impl FnOnce(&K, &Cancel) -> V + Send + 'static, ) -> Loaded<'_, V>
What to show for key (None: nothing is selected). Call it each
time the panel draws: load runs only when key changed, on the
worker, and the window is woken when its result is in.
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for Latest<K, V>
impl<K, V> RefUnwindSafe for Latest<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Latest<K, V>
impl<K, V> Sync for Latest<K, V>
impl<K, V> Unpin for Latest<K, V>
impl<K, V> UnsafeUnpin for Latest<K, V>where
K: UnsafeUnpin,
V: UnsafeUnpin,
impl<K, V> UnwindSafe for Latest<K, V>where
K: UnwindSafe,
V: UnwindSafe,
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 more