pub struct Animator { /* private fields */ }Implementations§
Source§impl Animator
impl Animator
pub fn set_timeline_origin(&mut self, origin: Instant)
pub fn script_set( &mut self, id: u32, node: u32, frames: Rc<Keyframes>, timing: ScriptTiming, )
pub fn has_script_animations(&self, node: u32) -> bool
pub fn script_node(&self, id: u32) -> Option<u32>
pub fn script_clock(&mut self, id: u32, clock: ScriptClock) -> Option<u32>
pub fn script_drop(&mut self, id: u32) -> Option<u32>
pub fn script_values( &self, id: u32, base: &StyleRefinement, now: Instant, ) -> Option<Vec<(String, String)>>
Source§impl Animator
impl Animator
pub fn new() -> Animator
Sourcepub fn set_reduce_motion(&mut self, reduce_motion: bool)
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.
Sourcepub fn set_interpolate_keywords(&mut self, node: u32, allow: bool)
pub fn set_interpolate_keywords(&mut self, node: u32, allow: bool)
The node’s inherited interpolate-size: whether auto sizes interpolate with lengths.
Sourcepub fn on_computed(
&mut self,
node: u32,
old: Option<&ComputedStates>,
new: &ComputedStates,
now: Instant,
)
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.
pub fn on_state( &mut self, node: u32, computed: &ComputedStates, target: Option<&StyleRefinement>, now: Instant, )
pub fn holds_state(&self, node: u32) -> bool
pub fn overlay( &self, node: u32, base: &StyleRefinement, now: Instant, ) -> Option<StyleRefinement>
pub fn any_active(&self, now: Instant) -> bool
pub fn settles_at(&self) -> Option<Instant>
Sourcepub fn finish_settled(&mut self, now: Instant) -> bool
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.
pub fn gc(&mut self, alive: &dyn Fn(u32) -> bool)
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Explicitly resets CSS motion state. A stylesheet replacement instead rebinds its keyframes
through on_computed_animations, preserving clocks.
pub fn is_idle(&self) -> bool
pub fn take_diagnostics(&mut self) -> Vec<String>
Source§impl Animator
impl Animator
pub fn on_computed_animations( &mut self, node: u32, new: &ComputedStates, now: Instant, resolve: &dyn Fn(&str) -> Option<Rc<Keyframes>>, )
pub fn cancel_animations(&mut self, node: u32, now: Instant)
pub fn has_animations(&self, node: u32) -> bool
Sourcepub fn animations_finished(&self, node: u32, now: Instant) -> bool
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.
pub fn tick(&mut self, now: Instant)
pub fn take_events(&mut self) -> Vec<AnimEvent>
pub fn moving_nodes(&self, now: Instant) -> impl Iterator<Item = u32> + '_
pub fn any_animation(&self, now: Instant) -> bool
pub fn animated_extras(&self, node: u32, now: Instant) -> Option<Extras>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Animator
impl !RefUnwindSafe for Animator
impl !Send for Animator
impl !Sync for Animator
impl !UnwindSafe for Animator
impl Forget for Animator
impl Move for Animator
impl Unpin for Animator
impl UnsafeUnpin for Animator
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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