pub struct LateValue<T> { /* private fields */ }Expand description
A cell showing a value that arrives late, in its four states.
Implementations§
Source§impl<T> LateValue<T>
impl<T> LateValue<T>
Sourcepub fn new(name: impl Into<String>, late: Late<T>) -> Self
pub fn new(name: impl Into<String>, late: Late<T>) -> Self
The value’s name (“Free space”: its accessible name) and state.
Sourcepub fn sample(self, text: impl Into<String>) -> Self
pub fn sample(self, text: impl Into<String>) -> Self
A text as wide as the value is expected to be (“000.0 GB”): the cell’s room while pending, kept once the value lands.
Sourcepub fn size(self, size: Vec2) -> Self
pub fn size(self, size: Vec2) -> Self
The value’s room at least (for LateValue::show_with, whose
drawing the cell cannot measure beforehand).
Sourcepub fn role(self, role: TextRole) -> Self
pub fn role(self, role: TextRole) -> Self
The text role of the value and of its sample (TextRole::Body
by default).
Sourcepub fn since(self, seconds: f64) -> Self
pub fn since(self, seconds: f64) -> Self
When the work started (motion clock seconds): the spinners then
wait motion.spinner.delay before showing, and stay
motion.spinner.min once shown (Spinner::delayed).
Sourcepub fn id_salt(self, salt: impl Hash + Debug) -> Self
pub fn id_salt(self, salt: impl Hash + Debug) -> Self
Tells cells of the same name apart (the delayed spinners’ state).
Sourcepub fn show_with(
self,
ui: &mut Ui,
add: impl FnOnce(&mut Ui, &T),
) -> LateResponse
pub fn show_with( self, ui: &mut Ui, add: impl FnOnce(&mut Ui, &T), ) -> LateResponse
Draws the cell, the value drawn by add in the value’s room.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for LateValue<T>where
T: Freeze,
impl<T> RefUnwindSafe for LateValue<T>where
T: RefUnwindSafe,
impl<T> Send for LateValue<T>where
T: Send,
impl<T> Sync for LateValue<T>where
T: Sync,
impl<T> Unpin for LateValue<T>where
T: Unpin,
impl<T> UnsafeUnpin for LateValue<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for LateValue<T>where
T: 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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