pub struct Progress(Bounded<ProgressBounds>);Expand description
A newtype rather than a Bounded<ProgressBounds> alias so the domain
methods below can be inherent: the clamping and the total order are
Bounded’s, everything a progress means is here.
Tuple Fields§
§0: Bounded<ProgressBounds>Implementations§
Source§impl Progress
impl Progress
pub const fn new(value: f32) -> Self
pub const fn get(self) -> f32
pub const fn zero() -> Self
pub const fn one() -> Self
pub fn is_complete(self) -> bool
Sourcepub fn through(elapsed: Duration, total: Duration) -> Self
pub fn through(elapsed: Duration, total: Duration) -> Self
How far elapsed has run through total (complete for a zero total).
Sourcepub fn complement(self) -> Self
pub fn complement(self) -> Self
The remaining fraction: 1 - self. Fades read as
opacity(t.complement()) instead of 1.0 - t at every site.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Progress
impl<'de> Deserialize<'de> for Progress
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Progress
impl Ord for Progress
Source§impl PartialOrd for Progress
impl PartialOrd for Progress
impl Copy for Progress
impl Eq for Progress
impl StructuralPartialEq for Progress
Auto Trait Implementations§
impl Freeze for Progress
impl RefUnwindSafe for Progress
impl Send for Progress
impl Sync for Progress
impl Unpin for Progress
impl UnsafeUnpin for Progress
impl UnwindSafe for Progress
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.