Struct SwitchMotion
pub struct SwitchMotion { /* private fields */ }Expand description
The motion of one switch: the retained Toggle keeps one, and so does
any host that paints switches itself (ToggleFace::pose), one per
switch it shows.
A change a click or a finger caused slides the knob and turns the track
(motion::ControlChange, fast, critically damped), and a second one
mid-flight reverses from where it is drawn. A key, an assistive action or
a value nobody just caused (a sync) lands at once. Reduced motion lands
the knob and still cross-fades the tint. The first value shown rests.
Settled, it asks for no frames.
Implementations§
§impl SwitchMotion
impl SwitchMotion
pub fn follow(
&mut self,
on: bool,
motion: EffectiveMotion,
source: MotionSource,
now: Instant,
)
pub fn follow( &mut self, on: bool, motion: EffectiveMotion, source: MotionSource, now: Instant, )
Show on, moving as source asks. The first value shown rests.
pub fn follow_input(&mut self, on: bool, motion: EffectiveMotion, now: Instant)
pub fn follow_input(&mut self, on: bool, motion: EffectiveMotion, now: Instant)
Show on as the input the person just made caused it
(motion::recent_input): a click slides, a key lands, and a change
nobody just caused (a sync, another device) lands.
pub fn hold(&mut self, knob: f64)
pub fn hold(&mut self, knob: f64)
The hand holds the knob at knob (0..=1 of its travel): drawn
exactly there.
pub fn release(
&mut self,
on: bool,
velocity: f64,
motion: EffectiveMotion,
now: Instant,
)
pub fn release( &mut self, on: bool, velocity: f64, motion: EffectiveMotion, now: Instant, )
The hand let go: settle on on, carrying its velocity (travel per
second).
pub fn pose(&self, motion: EffectiveMotion, now: Instant) -> SwitchPose
pub fn pose(&self, motion: EffectiveMotion, now: Instant) -> SwitchPose
How to draw the switch at now: the tint follows the knob, or
cross-fades on its own where reduced motion lands the knob.
Trait Implementations§
§impl Clone for SwitchMotion
impl Clone for SwitchMotion
§fn clone(&self) -> SwitchMotion
fn clone(&self) -> SwitchMotion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for SwitchMotion
impl Debug for SwitchMotion
§impl Default for SwitchMotion
impl Default for SwitchMotion
§fn default() -> SwitchMotion
fn default() -> SwitchMotion
impl Copy for SwitchMotion
Auto Trait Implementations§
impl Freeze for SwitchMotion
impl RefUnwindSafe for SwitchMotion
impl Send for SwitchMotion
impl Sync for SwitchMotion
impl Unpin for SwitchMotion
impl UnsafeUnpin for SwitchMotion
impl UnwindSafe for SwitchMotion
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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