pub struct AnyAnimation<T>where
T: 'static,{ /* private fields */ }Expand description
Erased Animation: one identity and a static vtable, the fat pointer
rustc cannot build for an arena id. No lease.
Like Handle, it names the animation without keeping it: what a call that
only uses an animation takes. A field or parameter Dart types as
Animation<T> keeps it and holds an AnimationRef<T>, which derefs to
this. The concrete animation stays in the App under its own type; the
handle carries its id plus a static dispatch table, so holding or copying one
borrows nothing, and the same object stays reachable through its typed
Handle for concrete-only members.
Equality is Dart’s == on an object reference: two handles are equal
exactly when they address the same object.
Implementations§
Source§impl<T> AnyAnimation<T>where
T: 'static,
impl<T> AnyAnimation<T>where
T: 'static,
Sourcepub fn downcast<A>(self, app: &App) -> Option<Handle<A>>where
A: 'static,
pub fn downcast<A>(self, app: &App) -> Option<Handle<A>>where
A: 'static,
Dart’s animation as A: the typed handle when this animation is an A, else None.
Sourcepub fn add_listener(self, app: &mut App, listener: Listener)
pub fn add_listener(self, app: &mut App, listener: Listener)
Calls the listener every time the value of the animation changes.
Listeners can be removed with remove_listener.
Sourcepub fn remove_listener(self, app: &mut App, listener: &Listener)
pub fn remove_listener(self, app: &mut App, listener: &Listener)
Stop calling the listener every time the value of the animation changes.
Listeners can be added with add_listener.
Sourcepub fn add_status_listener(
self,
app: &mut App,
listener: AnimationStatusListener,
)
pub fn add_status_listener( self, app: &mut App, listener: AnimationStatusListener, )
Calls listener every time the status of the animation changes.
Listeners can be removed with
remove_status_listener.
Sourcepub fn remove_status_listener(
self,
app: &mut App,
listener: &AnimationStatusListener,
)
pub fn remove_status_listener( self, app: &mut App, listener: &AnimationStatusListener, )
Stops calling the listener every time the status of the animation changes.
Listeners can be added with
add_status_listener.
Sourcepub fn status(self, app: &App) -> AnimationStatus
pub fn status(self, app: &App) -> AnimationStatus
The current status of this animation.
Sourcepub fn is_dismissed(self, app: &App) -> bool
pub fn is_dismissed(self, app: &App) -> bool
Whether this animation is stopped at the beginning.
Sourcepub fn is_completed(self, app: &App) -> bool
pub fn is_completed(self, app: &App) -> bool
Whether this animation is stopped at the end.
Sourcepub fn is_animating(self, app: &App) -> bool
pub fn is_animating(self, app: &App) -> bool
Whether this animation is running in either direction.
Sourcepub fn is_forward_or_completed(self, app: &App) -> bool
pub fn is_forward_or_completed(self, app: &App) -> bool
Whether the current aim of this animation is toward completion.
Source§impl<T> AnyAnimation<T>where
T: 'static,
impl<T> AnyAnimation<T>where
T: 'static,
Sourcepub fn upgrade(self, app: &App) -> Option<Retained<AnyAnimation<T>>>
pub fn upgrade(self, app: &App) -> Option<Retained<AnyAnimation<T>>>
A reference while something still keeps the object, None once it is freed or
its last keeper has let go; see Handle::upgrade.
Sourcepub fn keep(self, app: &App) -> Retained<AnyAnimation<T>>
pub fn keep(self, app: &App) -> Retained<AnyAnimation<T>>
A reference to an object something is known to keep; see
Handle::keep.
Trait Implementations§
Source§impl<T> Clone for AnyAnimation<T>
impl<T> Clone for AnyAnimation<T>
Source§fn clone(&self) -> AnyAnimation<T>
fn clone(&self) -> AnyAnimation<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<T> Copy for AnyAnimation<T>
Source§impl<T> Debug for AnyAnimation<T>
impl<T> Debug for AnyAnimation<T>
impl<T> Eq for AnyAnimation<T>where
T: 'static,
Source§impl<T, Leaf> From<Handle<Leaf>> for AnyAnimation<T>where
T: 'static,
Leaf: Animation<T>,
impl<T, Leaf> From<Handle<Leaf>> for AnyAnimation<T>where
T: 'static,
Leaf: Animation<T>,
Source§fn from(handle: Handle<Leaf>) -> AnyAnimation<T>
fn from(handle: Handle<Leaf>) -> AnyAnimation<T>
Source§impl<T> Hash for AnyAnimation<T>where
T: 'static,
impl<T> Hash for AnyAnimation<T>where
T: 'static,
Source§impl<T> ListenableHandle for AnyAnimation<T>where
T: 'static,
impl<T> ListenableHandle for AnyAnimation<T>where
T: 'static,
Source§fn add_listener_to(self, app: &mut App, listener: Listener)
fn add_listener_to(self, app: &mut App, listener: Listener)
Source§fn remove_listener_from(self, app: &mut App, listener: &Listener)
fn remove_listener_from(self, app: &mut App, listener: &Listener)
Source§impl<T> PartialEq for AnyAnimation<T>where
T: 'static,
impl<T> PartialEq for AnyAnimation<T>where
T: 'static,
Source§impl<T> PartialEq<AnyAnimation<T>> for &Retained<AnyAnimation<T>>where
T: 'static,
impl<T> PartialEq<AnyAnimation<T>> for &Retained<AnyAnimation<T>>where
T: 'static,
Auto Trait Implementations§
impl<T> Forget for AnyAnimation<T>
impl<T> Freeze for AnyAnimation<T>
impl<T> Move for AnyAnimation<T>
impl<T> RefUnwindSafe for AnyAnimation<T>
impl<T> Send for AnyAnimation<T>
impl<T> Sync for AnyAnimation<T>
impl<T> Unpin for AnyAnimation<T>
impl<T> UnsafeUnpin for AnyAnimation<T>where
NonZeroU32Inner: UnsafeUnpin,
&'static AnimationVTable<T>: UnsafeUnpin,
impl<T> UnwindSafe for AnyAnimation<T>
Blanket Implementations§
Source§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.