[−][src]Trait plotters_unstable::element::PointCollection
A type which is logically a collection of points, under any given coordinate system.
Note: Ideally, a point collection trait should be any type of which coordinate elements can be
iterated. This is similar to iter
method of many collection types in std.
trait PointCollection<Coord> { type PointIter<'a> : Iterator<Item = &'a Coord>; fn iter(&self) -> PointIter<'a>; }
However, Generic Associated Types is far away from stablize. So currently we have the following workaround:
Instead of implement the PointCollection trait on the element type itself, it implements on the reference to the element. By doing so, we now have a well-defined lifetime for the iterator.
In addition, for some element, the coordinate is computed on the fly, thus we can't hard-code
the iterator's return type is &'a Coord
.
Borrow
trait seems to strict in this case, since we don't need the order and hash
preservation properties at this point. However, AsRef
doesn't work with Coord
This workaround also leads overly strict lifetime bound on ChartContext::draw_series
.
TODO: Once GAT is ready on stable Rust, we should simplify the design.
Associated Types
type Point: Borrow<Coord> + 'a
The item in point iterator
type IntoIter: IntoIterator<Item = Self::Point>
The point iterator
Required methods
fn point_iter(self) -> Self::IntoIter
framework to do the coordinate mapping
Implementors
impl<'a, 'b, Coord> PointCollection<'a, Coord> for &'a BitMapElement<'b, Coord>
[src]
impl<'a, 'b: 'a, DB: DrawingBackend, Coord: Clone> PointCollection<'a, Coord> for &'a DynElement<'b, DB, Coord>
[src]
impl<'a, Coord> PointCollection<'a, Coord> for &'a PathElement<Coord>
[src]
impl<'a, Coord> PointCollection<'a, Coord> for &'a Pixel<Coord>
[src]
impl<'a, Coord> PointCollection<'a, Coord> for &'a Polygon<Coord>
[src]
impl<'a, Coord> PointCollection<'a, Coord> for &'a Rectangle<Coord>
[src]
impl<'a, Coord, DB: DrawingBackend> PointCollection<'a, Coord> for &'a EmptyElement<Coord, DB>
[src]
impl<'a, Coord, Size: SizeDesc> PointCollection<'a, Coord> for &'a Circle<Coord, Size>
[src]
impl<'a, Coord: 'a, Size: SizeDesc> PointCollection<'a, Coord> for &'a Cross<Coord, Size>
[src]
impl<'a, Coord: 'a, Size: SizeDesc> PointCollection<'a, Coord> for &'a TriangleMarker<Coord, Size>
[src]
impl<'a, K: Clone, O: BoxplotOrient<K, f32>> PointCollection<'a, (<O as BoxplotOrient<K, f32>>::XType, <O as BoxplotOrient<K, f32>>::YType)> for &'a Boxplot<K, O>
[src]
type Point = (O::XType, O::YType)
type IntoIter = Vec<Self::Point>
fn point_iter(self) -> Self::IntoIter
[src]
impl<'a, K: Clone, V: Clone, O: ErrorBarOrient<K, V>> PointCollection<'a, (<O as ErrorBarOrient<K, V>>::XType, <O as ErrorBarOrient<K, V>>::YType)> for &'a ErrorBar<K, V, O>
[src]
type Point = (O::XType, O::YType)
type IntoIter = Vec<Self::Point>
fn point_iter(self) -> Self::IntoIter
[src]
impl<'a, X: 'a, Y: PartialOrd + 'a> PointCollection<'a, (X, Y)> for &'a CandleStick<X, Y>
[src]
impl<'b, 'a, Coord: 'a, T: Borrow<str> + 'a> PointCollection<'a, Coord> for &'a MultiLineText<'b, Coord, T>
[src]
impl<'b, 'a, Coord: 'a, T: Borrow<str> + 'a> PointCollection<'a, Coord> for &'a Text<'b, Coord, T>
[src]
impl<'b, Coord, DB: DrawingBackend, A, B> PointCollection<'b, Coord> for &'b ComposedElement<Coord, DB, A, B> where
A: Drawable<DB>,
B: Drawable<DB>,
[src]
A: Drawable<DB>,
B: Drawable<DB>,