Struct Transient
pub struct Transient;Expand description
Something shown for a while that then goes on its own: a volume readout, an acknowledgement, a
player’s controls. A readout arrives at fast, a confirmation is there at once; both hold, then
fade over base so they are gone exactly when they expire. Pure functions of two instants, so
the owner keeps no motion state.
Implementations§
§impl Transient
impl Transient
pub const READOUT: MotionSpec
pub const READOUT: MotionSpec
A readout that arrives (a volume level, a player’s controls).
pub const CONFIRMATION: MotionSpec
pub const CONFIRMATION: MotionSpec
A confirmation, there the moment the action is done; also chrome the pointer wakes (a player’s controls).
pub fn exit_time(spec: MotionSpec, motion: EffectiveMotion) -> Duration
pub fn exit_time(spec: MotionSpec, motion: EffectiveMotion) -> Duration
How long its exit fade takes.
pub fn enter_time(spec: MotionSpec, motion: EffectiveMotion) -> Duration
pub fn enter_time(spec: MotionSpec, motion: EffectiveMotion) -> Duration
How long its arrival takes.
pub fn exit_starts(
spec: MotionSpec,
expires: Instant,
motion: EffectiveMotion,
) -> Instant
pub fn exit_starts( spec: MotionSpec, expires: Instant, motion: EffectiveMotion, ) -> Instant
When the exit fade starts, for something that expires at expires.
pub fn exit_progress(
spec: MotionSpec,
since: Instant,
now: Instant,
motion: EffectiveMotion,
) -> f64
pub fn exit_progress( spec: MotionSpec, since: Instant, now: Instant, motion: EffectiveMotion, ) -> f64
How far through its exit fade something leaving at since is at now, 0..=1: the fade
takes the motion’s own exit time.
pub fn opacity(
spec: MotionSpec,
_: (Instant, Instant),
now: Instant,
motion: EffectiveMotion,
) -> f32
pub fn opacity( spec: MotionSpec, _: (Instant, Instant), now: Instant, motion: EffectiveMotion, ) -> f32
Its opacity at now, shown since shown and gone at expires.
pub fn is_moving(
spec: MotionSpec,
_: (Instant, Instant),
now: Instant,
motion: EffectiveMotion,
) -> bool
pub fn is_moving( spec: MotionSpec, _: (Instant, Instant), now: Instant, motion: EffectiveMotion, ) -> bool
Whether its opacity changes at now (arriving or fading), so its owner needs frames.
Auto Trait Implementations§
impl Freeze for Transient
impl RefUnwindSafe for Transient
impl Send for Transient
impl Sync for Transient
impl Unpin for Transient
impl UnsafeUnpin for Transient
impl UnwindSafe for Transient
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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