pub struct UniformNestedRange<Primary: DiscreteRanged, Secondary: Ranged> { /* private fields */ }
Expand description
Like plotters::coord::combinators::NestedRange
, except the nested coordinate system is the
same for every item in the outer coordinate system.
That is, each value in the discrete ranged coordinate system has an associated secondary
coordinate system. The value type is UniformNestedValue
- most of the time, you just want
UniformNestedValue::Value
- and a From
implementation for tuples is provided as such.
Because of this uniformity, this can be used very efficiently, even recursively, and even with
large Primary
coordinate systems - including both as a primary coordinate system itself, or
as a secondary coordinate system. This is because it lacks the need to scan all the
potentially-variadic coordinate systems when doing discrete value indexing.
Important to note here - The coordinate ranges produced by coordinate systems are typically
[inclusive, exclusive) style - they include the lower value and exclude the upper value. This
remains true for this coordinate system. However, when working with both UniformNestedRange
and plotters::coord::combinators::NestedRange
, typically the final value of the primary
coordinate system is actually included, and it’s only the last value of the secondary
coordinate systems that is excluded. This means that it may extend one-further within the
primary coordinate system than is expected.
Trait Implementations§
Source§impl<Primary: DiscreteRanged, Secondary: DiscreteRanged> DiscreteRanged for UniformNestedRange<Primary, Secondary>
Efficient implementation of uniformly-nested DiscreteRanged
. Even in uses which require
very large amounts of indexing operations, this should be significantly more efficient than
plotters::coord::combinators::NestedRange
, because of the lack of a need to traverse
linearly through dynamic secondary coordinate systems.
impl<Primary: DiscreteRanged, Secondary: DiscreteRanged> DiscreteRanged for UniformNestedRange<Primary, Secondary>
Efficient implementation of uniformly-nested DiscreteRanged
. Even in uses which require
very large amounts of indexing operations, this should be significantly more efficient than
plotters::coord::combinators::NestedRange
, because of the lack of a need to traverse
linearly through dynamic secondary coordinate systems.