pub struct Rectangle<'a, Coord> { /* private fields */ }
Expand description
A rectangle element
Implementations§
Source§impl<'a, Coord> Rectangle<'a, Coord>
impl<'a, Coord> Rectangle<'a, Coord>
Sourcepub fn new<S: Into<ShapeStyle<'a>>>(points: [Coord; 2], style: S) -> Self
pub fn new<S: Into<ShapeStyle<'a>>>(points: [Coord; 2], style: S) -> Self
Create a new path
points
: The left upper and right lower coner of the rectanglestyle
: The shape style- returns the created element
Trait Implementations§
Source§impl<'a, Coord: 'a, DB: DrawingBackend> Drawable<DB> for Rectangle<'a, Coord>
impl<'a, Coord: 'a, DB: DrawingBackend> Drawable<DB> for Rectangle<'a, Coord>
Source§fn draw<I: Iterator<Item = BackendCoord>>(
&self,
points: I,
backend: &mut DB,
) -> Result<(), DrawingErrorKind<DB::ErrorType>>
fn draw<I: Iterator<Item = BackendCoord>>( &self, points: I, backend: &mut DB, ) -> Result<(), DrawingErrorKind<DB::ErrorType>>
Actually draws the element. The key points is already translated into the
image cooridnate and can be used by DC directly
Auto Trait Implementations§
impl<'a, Coord> Freeze for Rectangle<'a, Coord>where
Coord: Freeze,
impl<'a, Coord> !RefUnwindSafe for Rectangle<'a, Coord>
impl<'a, Coord> !Send for Rectangle<'a, Coord>
impl<'a, Coord> !Sync for Rectangle<'a, Coord>
impl<'a, Coord> Unpin for Rectangle<'a, Coord>where
Coord: Unpin,
impl<'a, Coord> !UnwindSafe for Rectangle<'a, Coord>
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, DB, Coord> IntoDynElement<DB, Coord> for Twhere
T: Drawable<DB> + 'static,
&'a T: for<'a> PointCollection<'a, Coord>,
Coord: Clone,
DB: DrawingBackend,
impl<T, DB, Coord> IntoDynElement<DB, Coord> for Twhere
T: Drawable<DB> + 'static,
&'a T: for<'a> PointCollection<'a, Coord>,
Coord: Clone,
DB: DrawingBackend,
Source§fn into_dyn(self) -> DynElement<DB, Coord>
fn into_dyn(self) -> DynElement<DB, Coord>
Make the conversion
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more