Skip to main content

ferroui_base/media/
points.rs

1use crate::media::media_collection::media_collection_type;
2use crate::media::MediaCollection;
3use crate::Point;
4
5media_collection_type!(
6    /// Represents a collection of [`Point`] values that can be individually
7    /// accessed by index.
8    Points, Point
9);
10
11impl Points {
12    /// Creates an empty collection.
13    pub fn new() -> Self {
14        Self(MediaCollection::new())
15    }
16
17    /// Creates a collection holding `points`.
18    pub fn from_items(points: impl IntoIterator<Item = Point>) -> Self {
19        Self(MediaCollection::from_items(points))
20    }
21}