pub struct Led<Color: ColorType> {
pub color: Color,
/* private fields */
}
Expand description
An LED in our Sled configuration, representing both the color of the LED as well as it’s spatial information.
Fields§
§color: Color
Implementations§
Source§impl<Color: ColorType> Led<Color>
All properties listed below are pre-calculated on construction;
there is no substantial overhead for calling these methods.
impl<Color: ColorType> Led<Color>
All properties listed below are pre-calculated on construction; there is no substantial overhead for calling these methods.
Sourcepub fn direction(&self) -> Vec2
pub fn direction(&self) -> Vec2
Returns the direction from the Sled’s center_point
to this Led. A normalized vector.
Sourcepub fn angle(&self) -> f32
pub fn angle(&self) -> f32
Returns the angle from the Sled’s center_point
to this Led in radians.
The direction (1, 0)
is considered 0 radians, (0, -1)
is pi/2 radian.
Trait Implementations§
Source§impl<Color: ColorType> Ord for Led<Color>
impl<Color: ColorType> Ord for Led<Color>
Source§impl<Color: ColorType> PartialOrd for Led<Color>
impl<Color: ColorType> PartialOrd for Led<Color>
impl<Color: Copy + ColorType> Copy for Led<Color>
impl<Color: ColorType> Eq for Led<Color>
Auto Trait Implementations§
impl<Color> Freeze for Led<Color>where
Color: Freeze,
impl<Color> RefUnwindSafe for Led<Color>where
Color: RefUnwindSafe,
impl<Color> Send for Led<Color>where
Color: Send,
impl<Color> Sync for Led<Color>where
Color: Sync,
impl<Color> Unpin for Led<Color>where
Color: Unpin,
impl<Color> UnwindSafe for Led<Color>where
Color: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string()
Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString
. Read more