pub trait CompoundAnimation<T>:
Animation<T>
+ AnimationLazyListenerMixin
+ AnimationLocalListenersMixin
+ AnimationLocalStatusListenersMixin{
// Required methods
fn first(self: Handle<Self>, app: &App) -> AnyAnimation<T>;
fn next(self: Handle<Self>, app: &App) -> AnyAnimation<T>;
fn last_status(self: Handle<Self>, app: &App) -> Option<AnimationStatus>;
fn last_status_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut Option<AnimationStatus>;
fn last_value(self: Handle<Self>, app: &App) -> &Option<T>;
fn last_value_mut(self: Handle<Self>, app: &mut App) -> &mut Option<T>;
// Provided methods
fn status(self: Handle<Self>, app: &App) -> AnimationStatus { ... }
fn maybe_notify_status_listeners(
self: Handle<Self>,
app: &mut App,
_status: AnimationStatus,
) { ... }
fn maybe_notify_listeners(self: Handle<Self>, app: &mut App) { ... }
}Expand description
An interface for combining multiple Animations. Implementors need only
implement Animation::value to control how the child animations are
combined. Can be chained to combine more than 2 animations.
For example, to create an animation that is the sum of two others,
implement this trait and define value as first.value + next.value.
By default, the status of a compound animation is the status of the
next animation if next is moving, and the status of the first
animation otherwise.
Dart’s CompoundAnimation<T> is an abstract class whose handlers call the
subclass’s value override. The upward call is what makes it a trait here;
it reaches the override through as_animation, the erased handle, whose
vtable is built from the subclass’s Animation impl. The fields Dart
declares on the abstract class belong to the implementing type and reach
the trait through the app-mediated accessors.
Required Methods§
Sourcefn first(self: Handle<Self>, app: &App) -> AnyAnimation<T>
fn first(self: Handle<Self>, app: &App) -> AnyAnimation<T>
The first sub-animation. Its status takes precedence if neither are animating.
Sourcefn next(self: Handle<Self>, app: &App) -> AnyAnimation<T>
fn next(self: Handle<Self>, app: &App) -> AnyAnimation<T>
The second sub-animation.
Sourcefn last_status(self: Handle<Self>, app: &App) -> Option<AnimationStatus>
fn last_status(self: Handle<Self>, app: &App) -> Option<AnimationStatus>
Dart’s _lastStatus, owned by the implementing type.
Sourcefn last_status_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut Option<AnimationStatus>
fn last_status_mut( self: Handle<Self>, app: &mut App, ) -> &mut Option<AnimationStatus>
Dart’s _lastStatus, mutably.
Sourcefn last_value(self: Handle<Self>, app: &App) -> &Option<T>
fn last_value(self: Handle<Self>, app: &App) -> &Option<T>
Dart’s _lastValue, owned by the implementing type.
Sourcefn last_value_mut(self: Handle<Self>, app: &mut App) -> &mut Option<T>
fn last_value_mut(self: Handle<Self>, app: &mut App) -> &mut Option<T>
Dart’s _lastValue, mutably.
Provided Methods§
Sourcefn status(self: Handle<Self>, app: &App) -> AnimationStatus
fn status(self: Handle<Self>, app: &App) -> AnimationStatus
Sourcefn maybe_notify_status_listeners(
self: Handle<Self>,
app: &mut App,
_status: AnimationStatus,
)
fn maybe_notify_status_listeners( self: Handle<Self>, app: &mut App, _status: AnimationStatus, )
Dart’s _maybeNotifyStatusListeners.
Sourcefn maybe_notify_listeners(self: Handle<Self>, app: &mut App)
fn maybe_notify_listeners(self: Handle<Self>, app: &mut App)
Dart’s _maybeNotifyListeners.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".