Skip to main content

Animator

Struct Animator 

Source
pub struct Animator { /* private fields */ }

Implementations§

Source§

impl Animator

Source

pub fn set_timeline_origin(&mut self, origin: Instant)

Source

pub fn script_set( &mut self, id: u32, node: u32, frames: Rc<Keyframes>, timing: ScriptTiming, )

Source

pub fn has_script_animations(&self, node: u32) -> bool

Source

pub fn script_node(&self, id: u32) -> Option<u32>

Source

pub fn script_clock(&mut self, id: u32, clock: ScriptClock) -> Option<u32>

Source

pub fn script_drop(&mut self, id: u32) -> Option<u32>

Source

pub fn script_values( &self, id: u32, base: &StyleRefinement, now: Instant, ) -> Option<Vec<(String, String)>>

Source§

impl Animator

Source

pub fn new() -> Animator

Source

pub fn set_reduce_motion(&mut self, reduce_motion: bool)

Mirrors gpui::App::reduce_motion(). While set, values snap instead of animating (gpui’s own animations behave the same way); turning it on also cancels whatever is running.

Source

pub fn set_interpolate_keywords(&mut self, node: u32, allow: bool)

The node’s inherited interpolate-size: whether auto sizes interpolate with lengths.

Source

pub fn on_computed( &mut self, node: u32, old: Option<&ComputedStates>, new: &ComputedStates, now: Instant, )

old = None is the first styling of the node: CSS does not transition initial style, so leftover tracks are dropped.

Source

pub fn on_state( &mut self, node: u32, computed: &ComputedStates, target: Option<&StyleRefinement>, now: Instant, )

Source

pub fn holds_state(&self, node: u32) -> bool

Source

pub fn overlay( &self, node: u32, base: &StyleRefinement, now: Instant, ) -> Option<StyleRefinement>

Source

pub fn any_active(&self, now: Instant) -> bool

Source

pub fn settles_at(&self) -> Option<Instant>

Source

pub fn finish_settled(&mut self, now: Instant) -> bool

Drops tracks that have reached their target, and says whether any did: the last frame that painted one showed a value short of its end, so one more frame must be drawn.

Source

pub fn gc(&mut self, alive: &dyn Fn(u32) -> bool)

Source

pub fn clear(&mut self)

Explicitly resets CSS motion state. A stylesheet replacement instead rebinds its keyframes through on_computed_animations, preserving clocks.

Source

pub fn is_idle(&self) -> bool

Source

pub fn take_diagnostics(&mut self) -> Vec<String>

Source§

impl Animator

Source

pub fn on_computed_animations( &mut self, node: u32, new: &ComputedStates, now: Instant, resolve: &dyn Fn(&str) -> Option<Rc<Keyframes>>, )

Source

pub fn cancel_animations(&mut self, node: u32, now: Instant)

Source

pub fn has_animations(&self, node: u32) -> bool

Source

pub fn animations_finished(&self, node: u32, now: Instant) -> bool

No CSS animation of node is still to finish; a paused one is not finished.

Source

pub fn tick(&mut self, now: Instant)

Source

pub fn take_events(&mut self) -> Vec<AnimEvent>

Source

pub fn moving_nodes(&self, now: Instant) -> impl Iterator<Item = u32> + '_

Source

pub fn any_animation(&self, now: Instant) -> bool

Source

pub fn animated_extras(&self, node: u32, now: Instant) -> Option<Extras>

Trait Implementations§

Source§

impl Default for Animator

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more