Struct embedded_graphics::primitives::line::Line [−][src]
Line primitive
Fields
start: Coord
Start point
end: Coord
End point
color: Color
Line color
Methods
impl Line[src]
impl LineTrait Implementations
impl Debug for Line[src]
impl Debug for Linefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Copy for Line[src]
impl Copy for Lineimpl Clone for Line[src]
impl Clone for Linefn clone(&self) -> Line[src]
fn clone(&self) -> LineReturns 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<'a> IntoIterator for &'a Line[src]
impl<'a> IntoIterator for &'a Linetype Item = Pixel
The type of the elements being iterated over.
type IntoIter = LineIterator<'a>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter[src]
fn into_iter(self) -> Self::IntoIterCreates an iterator from a value. Read more
impl Drawable for Line[src]
impl Drawable for Lineimpl Transform for Line[src]
impl Transform for Linefn translate(&self, by: Coord) -> Self[src]
fn translate(&self, by: Coord) -> SelfTranslate 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), 1); 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 SelfTranslate 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), 1); line.translate_mut(Coord::new(10, 10)); assert_eq!(line.start, Coord::new(15, 20)); assert_eq!(line.end, Coord::new(25, 30));