pub struct Rectangle<Coord> { /* private fields */ }
Expand description
A rectangle element
Implementations§
Source§impl<Coord> Rectangle<Coord>
impl<Coord> Rectangle<Coord>
Sourcepub fn new<S: Into<ShapeStyle>>(points: [Coord; 2], style: S) -> Self
pub fn new<S: Into<ShapeStyle>>(points: [Coord; 2], style: S) -> Self
Create a new path
points
: The left upper and right lower corner of the rectanglestyle
: The shape style- returns the created element
Sourcepub fn set_margin(&mut self, t: u32, b: u32, l: u32, r: u32) -> &mut Self
pub fn set_margin(&mut self, t: u32, b: u32, l: u32, r: u32) -> &mut Self
Set the margin of the rectangle
t
: The top marginb
: The bottom marginl
: The left marginr
: The right margin
Sourcepub fn get_points(&self) -> (&Coord, &Coord)
pub fn get_points(&self) -> (&Coord, &Coord)
Get the points of the rectangle
- returns the element points
Sourcepub fn set_style<S: Into<ShapeStyle>>(&mut self, style: S) -> &mut Self
pub fn set_style<S: Into<ShapeStyle>>(&mut self, style: S) -> &mut Self
Set the style of the rectangle
style
: The shape style- returns a mut reference to the rectangle
Trait Implementations§
Source§impl<Coord, DB: DrawingBackend> Drawable<DB> for Rectangle<Coord>
impl<Coord, DB: DrawingBackend> Drawable<DB> for Rectangle<Coord>
Auto Trait Implementations§
impl<Coord> Freeze for Rectangle<Coord>where
Coord: Freeze,
impl<Coord> RefUnwindSafe for Rectangle<Coord>where
Coord: RefUnwindSafe,
impl<Coord> Send for Rectangle<Coord>where
Coord: Send,
impl<Coord> Sync for Rectangle<Coord>where
Coord: Sync,
impl<Coord> Unpin for Rectangle<Coord>where
Coord: Unpin,
impl<Coord> UnwindSafe for Rectangle<Coord>where
Coord: 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<'b, T, DB, Coord> IntoDynElement<'b, DB, Coord> for Twhere
T: Drawable<DB> + 'b,
&'a T: for<'a> PointCollection<'a, Coord>,
Coord: Clone,
DB: DrawingBackend,
impl<'b, T, DB, Coord> IntoDynElement<'b, DB, Coord> for Twhere
T: Drawable<DB> + 'b,
&'a T: for<'a> PointCollection<'a, Coord>,
Coord: Clone,
DB: DrawingBackend,
Source§fn into_dyn(self) -> DynElement<'b, DB, Coord>
fn into_dyn(self) -> DynElement<'b, DB, Coord>
Make the conversion
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.