RKTK API Docs RKTK Home Repo

Trait Layout1d

Source
pub trait Layout1d {
    const PIXEL_COUNT: usize;

    // Provided method
    fn points() -> impl Iterator<Item = f32> { ... }
}
Expand description

Trait for one-dimensional LED layouts.

Implementors of this trait represent a linear arrangement of LEDs.

Use layout1d! to define a type that implements Layout1d.

For our 1D space, the first LED pixel will be at -1.0 and the last LED pixel will be at 1.0.

Required Associated Constants§

Source

const PIXEL_COUNT: usize

The total number of LEDs in this layout.

Provided Methods§

Source

fn points() -> impl Iterator<Item = f32>

Returns an iterator over all points (LED positions) in this layout.

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.

Implementors§