Struct embedded_graphics::primitives::line::Line [−][src]
pub struct Line<C: PixelColor> { pub start: Coord, pub end: Coord, pub style: Style<C>, }
Line primitive
Fields
start: Coord
Start point
end: Coord
End point
style: Style<C>
Line style
Methods
impl<C> Line<C> where
C: PixelColor,
[src]
impl<C> Line<C> where
C: PixelColor,
Trait Implementations
impl<C: Debug + PixelColor> Debug for Line<C>
[src]
impl<C: Debug + PixelColor> Debug for Line<C>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<C: Copy + PixelColor> Copy for Line<C>
[src]
impl<C: Copy + PixelColor> Copy for Line<C>
impl<C: Clone + PixelColor> Clone for Line<C>
[src]
impl<C: Clone + PixelColor> Clone for Line<C>
fn clone(&self) -> Line<C>
[src]
fn clone(&self) -> Line<C>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<C> WithStyle<C> for Line<C> where
C: PixelColor,
[src]
impl<C> WithStyle<C> for Line<C> where
C: PixelColor,
fn with_style(self, style: Style<C>) -> Self
[src]
fn with_style(self, style: Style<C>) -> Self
Add a complete style to the object
fn with_stroke(self, color: Option<C>) -> Self
[src]
fn with_stroke(self, color: Option<C>) -> Self
Set the stroke colour for the object Read more
fn with_stroke_width(self, width: u8) -> Self
[src]
fn with_stroke_width(self, width: u8) -> Self
Set the stroke width for the object Read more
fn with_fill(self, color: Option<C>) -> Self
[src]
fn with_fill(self, color: Option<C>) -> Self
Set the fill property of the object's style Read more
impl<'a, C: PixelColor> IntoIterator for &'a Line<C>
[src]
impl<'a, C: PixelColor> IntoIterator for &'a Line<C>
type Item = Pixel<C>
The type of the elements being iterated over.
type IntoIter = LineIterator<'a, C>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl<C> Drawable for Line<C> where
C: PixelColor,
[src]
impl<C> Drawable for Line<C> where
C: PixelColor,
impl<C> Transform for Line<C> where
C: PixelColor,
[src]
impl<C> Transform for Line<C> where
C: PixelColor,
fn translate(&self, by: Coord) -> Self
[src]
fn translate(&self, by: Coord) -> Self
Translate the line from its current position to a new position by (x, y) pixels, returning
a new Line
. For a mutating transform, see translate_mut
.
let line = Line::new(Coord::new(5, 10), Coord::new(15, 20)) let moved = line.translate(Coord::new(10, 10)); assert_eq!(moved.start, Coord::new(15, 20)); assert_eq!(moved.end, Coord::new(25, 30));
fn translate_mut(&mut self, by: Coord) -> &mut Self
[src]
fn translate_mut(&mut self, by: Coord) -> &mut Self
Translate the line from its current position to a new position by (x, y) pixels.
let mut line = Line::new(Coord::new(5, 10), Coord::new(15, 20)) line.translate_mut(Coord::new(10, 10)); assert_eq!(line.start, Coord::new(15, 20)); assert_eq!(line.end, Coord::new(25, 30));