pub struct Kind { /* private fields */ }Expand description
The sort of work a row stands for: a dotted name and, optionally, a title.
The name is the same for every row of that sort, such as
flm.graphics.convert; the run gives the row of a stage the stage’s name.
The feature that owns the work declares its kind as a constant where the
work is done, and passes it by reference to Scope::child:
use flm_core::progress::Kind;
const CONVERT: Kind = Kind::titled("flm.graphics.convert", "Converting graphics");
assert_eq!(CONVERT.name(), "flm.graphics.convert");Kinds are not registered. A display identifies a sort of row by the name, so renaming a kind is a change that a host’s stored data about that kind (such as its measured durations) does not follow.
The title is the fixed text that a display shows for the rows of the kind, before the label of the row: “Converting graphics figure-3.pdf”. A title says what is being done: it begins with a capital and a verb in “-ing”, has no article and no final period, and names nothing of the library’s internals (“Reading document”, “Fetching citation data”). A kind whose rows a person need not see has no title; a display then shows the nearest row above that has one.
Implementations§
Source§impl Kind
impl Kind
Sourcepub const fn titled(name: &'static str, title: &'static str) -> Kind
pub const fn titled(name: &'static str, title: &'static str) -> Kind
A kind named name, with the title title.
A kind with no title whose name is a text the caller already holds, such as the name of a stage; the text is shared, not copied.
Trait Implementations§
impl Eq for Kind
impl StructuralPartialEq for Kind
Auto Trait Implementations§
impl Forget for Kind
impl Freeze for Kind
impl Move for Kind
impl RefUnwindSafe for Kind
impl Send for Kind
impl Sync for Kind
impl Unpin for Kind
impl UnsafeUnpin for Kind
impl UnwindSafe for Kind
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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