pub trait Layout2d {
const PIXEL_COUNT: usize;
// Required method
fn shapes() -> impl Iterator<Item = Shape2d>;
// Provided method
fn points() -> impl Iterator<Item = Vec2> { ... }
}
Expand description
Trait for two-dimensional LED layouts.
Implementors of this trait represent a 2D arrangement of LEDs using one or more shapes.
Use layout2d!
to define a type that implements Layout2d
.
For our 2D space, we can think of:
(-1.0, -1.0)
as the bottom left(1.0, -1.0)
as the bottom right(-1.0, 1.0)
as the top left(1.0, 1.0)
as the top right
Required Associated Constants§
Sourceconst PIXEL_COUNT: usize
const PIXEL_COUNT: usize
The total number of LEDs in this layout.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.