pub struct MotionSpec {
pub duration_ms: u64,
pub delay_ms: u64,
pub curve: CubicBezier,
}Expand description
One catalog entry: duration + optional delay + curve. The delay is folded into
the gpui animation timeline (gpui Animation has no native delay): the
animation runs for delay + duration and progress holds 0
until the delay has elapsed.
Fields§
§duration_ms: u64§delay_ms: u64§curve: CubicBezierImplementations§
Source§impl MotionSpec
impl MotionSpec
pub const fn new(duration_ms: u64, curve: CubicBezier) -> Self
pub const fn with_delay(self, delay_ms: u64) -> Self
Sourcepub fn progress(&self, raw_delta: f32) -> f32
pub fn progress(&self, raw_delta: f32) -> f32
Eased progress (0..1) for a raw timeline delta (0..1 across total).
Pure — unit-testable without a window.
Sourcepub fn animation(&self) -> Animation
pub fn animation(&self) -> Animation
A oneshot gpui Animation for this spec (delay folded in).
Wall-clock span honors speed_scale (measurement knob).
Trait Implementations§
Source§impl Clone for MotionSpec
impl Clone for MotionSpec
Source§fn clone(&self) -> MotionSpec
fn clone(&self) -> MotionSpec
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 MotionSpec
Source§impl Debug for MotionSpec
impl Debug for MotionSpec
Source§impl PartialEq for MotionSpec
impl PartialEq for MotionSpec
impl StructuralPartialEq for MotionSpec
Auto Trait Implementations§
impl Freeze for MotionSpec
impl RefUnwindSafe for MotionSpec
impl Send for MotionSpec
impl Sync for MotionSpec
impl Unpin for MotionSpec
impl UnsafeUnpin for MotionSpec
impl UnwindSafe for MotionSpec
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> 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