pub struct TaskList<'a, Msg> { /* private fields */ }Expand description
Shows a Tasks model as rows built from existing widgets.
A running task shows a Spinner, its label, its latest note and, when it reports a
fraction, a ProgressBar. A finished task shows a status icon with a word: a success check
with done, a danger cross with the failure reason, a muted dash with cancelled. Columns
line up across rows. With no tasks it shows the empty text in faint type.
Plain by default; on_cancel adds a cancel button to running rows. Words come from
quvyta.tasks.done, quvyta.tasks.cancelled, quvyta.tasks.cancel and
quvyta.tasks.empty; icons success, error and check-partial.
Implementations§
Source§impl<'a, Msg: Clone + 'static> TaskList<'a, Msg>
impl<'a, Msg: Clone + 'static> TaskList<'a, Msg>
Sourcepub fn empty_text(self, text: impl Into<String>) -> Self
pub fn empty_text(self, text: impl Into<String>) -> Self
Text shown when there are no tasks, instead of quvyta.tasks.empty.
Sourcepub fn on_cancel(self, message: impl Fn(TaskId) -> Msg + 'a) -> Self
pub fn on_cancel(self, message: impl Fn(TaskId) -> Msg + 'a) -> Self
Adds a cancel button to every running task; the message usually returns
Command::cancel_task.
Auto Trait Implementations§
impl<'a, Msg> !RefUnwindSafe for TaskList<'a, Msg>
impl<'a, Msg> !Send for TaskList<'a, Msg>
impl<'a, Msg> !Sync for TaskList<'a, Msg>
impl<'a, Msg> !UnwindSafe for TaskList<'a, Msg>
impl<'a, Msg> Freeze for TaskList<'a, Msg>
impl<'a, Msg> Unpin for TaskList<'a, Msg>
impl<'a, Msg> UnsafeUnpin for TaskList<'a, Msg>
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> 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> ⓘ
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> ⓘ
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