pub struct MotionPrefs {
pub reduced: bool,
pub time_scale: f32,
}Expand description
App-wide motion policy, plain data. The UI layer reads it; Animated takes it per retarget.
Fields§
§reduced: boolReduce motion (the OS accessibility setting or a user override): see Class::reduce.
time_scale: f32Clock speed for motion: 1 normal, 0 paused, 0.25 slow motion. The caller’s clock applies
it; read it through MotionPrefs::scale, which keeps it within 0..=10.
Implementations§
Source§impl MotionPrefs
impl MotionPrefs
Sourcepub const DEFAULT: MotionPrefs
pub const DEFAULT: MotionPrefs
Full motion at normal speed.
Sourcepub const REDUCED: MotionPrefs
pub const REDUCED: MotionPrefs
Reduced motion at normal speed.
Sourcepub const MAX_TIME_SCALE: f32 = 10.0
pub const MAX_TIME_SCALE: f32 = 10.0
The largest time scale.
Sourcepub const fn new(reduced: bool, time_scale: f32) -> MotionPrefs
pub const fn new(reduced: bool, time_scale: f32) -> MotionPrefs
Preferences with time_scale clamped to 0..=10 (NaN is 1).
Trait Implementations§
Source§impl Clone for MotionPrefs
impl Clone for MotionPrefs
Source§fn clone(&self) -> MotionPrefs
fn clone(&self) -> MotionPrefs
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MotionPrefs
Source§impl Debug for MotionPrefs
impl Debug for MotionPrefs
Source§impl Default for MotionPrefs
impl Default for MotionPrefs
Source§fn default() -> MotionPrefs
fn default() -> MotionPrefs
Returns the “default value” for a type. Read more
Source§impl PartialEq for MotionPrefs
impl PartialEq for MotionPrefs
impl StructuralPartialEq for MotionPrefs
Auto Trait Implementations§
impl Forget for MotionPrefs
impl Freeze for MotionPrefs
impl Move for MotionPrefs
impl RefUnwindSafe for MotionPrefs
impl Send for MotionPrefs
impl Sync for MotionPrefs
impl Unpin for MotionPrefs
impl UnsafeUnpin for MotionPrefs
impl UnwindSafe for MotionPrefs
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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