Enum buffer_graphics_lib::shapes::Shape
source · [−]pub enum Shape {
Line {
start: Coord,
end: Coord,
color: Color,
},
Rect {
topleft: Coord,
bottomright: Coord,
draw_type: DrawType,
},
Circle {
center: Coord,
radius: usize,
draw_type: DrawType,
},
Triangle {
points: [Coord; 3],
draw_type: DrawType,
},
}
Variants
Line
Rect
Circle
Triangle
Implementations
sourceimpl Shape
impl Shape
pub fn line<P1: Into<Coord>, P2: Into<Coord>>(
start: P1,
end: P2,
color: Color
) -> Shape
pub fn rect<P1: Into<Coord>, P2: Into<Coord>>(
topleft: P1,
bottomright: P2,
draw_type: DrawType
) -> Shape
pub fn circle<P: Into<Coord>>(
center: P,
radius: usize,
draw_type: DrawType
) -> Shape
pub fn triangle<P1: Into<Coord>, P2: Into<Coord>, P3: Into<Coord>>(
point1: P1,
point2: P2,
point3: P3,
draw_type: DrawType
) -> Shape
sourceimpl Shape
impl Shape
pub fn draw_type(&self) -> DrawType
pub fn with_draw_type(&self, draw_type: DrawType) -> Self
pub fn translate_by<P: Into<Coord>>(&self, delta: P) -> Self
pub fn move_to<P: Into<Coord>>(&self, point: P) -> Self
pub fn contains<P: Into<Coord>>(&self, point: P) -> bool
pub fn points(&self) -> Vec<Coord>
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Shape
impl<'de> Deserialize<'de> for Shape
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<Shape> for Shape
impl PartialEq<Shape> for Shape
impl Eq for Shape
impl StructuralEq for Shape
impl StructuralPartialEq for Shape
Auto Trait Implementations
impl RefUnwindSafe for Shape
impl Send for Shape
impl Sync for Shape
impl Unpin for Shape
impl UnwindSafe for Shape
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more