ferroui_base/animation/
key_frames.rs1use crate::animation::KeyFrame;
2use crate::collections::{FerroList, ResetBehavior};
3use crate::Ref;
4use std::ops::Deref;
5
6#[derive(Clone, PartialEq, Debug)]
12pub struct KeyFrames(FerroList<Ref<KeyFrame>>);
13
14impl KeyFrames {
15 pub fn new() -> Self {
17 let list = FerroList::new();
18 list.set_reset_behavior(ResetBehavior::Remove);
19 Self(list)
20 }
21
22 pub fn from_items(items: impl IntoIterator<Item = Ref<KeyFrame>>) -> Self {
24 let list = FerroList::from_items(items);
25 list.set_reset_behavior(ResetBehavior::Remove);
26 Self(list)
27 }
28}
29
30impl Default for KeyFrames {
31 fn default() -> Self {
32 Self::new()
33 }
34}
35
36impl Deref for KeyFrames {
37 type Target = FerroList<Ref<KeyFrame>>;
38
39 fn deref(&self) -> &Self::Target {
40 &self.0
41 }
42}