pub struct Line { /* private fields */ }
Implementations§
Trait Implementations§
Source§impl ContainsShape for Line
impl ContainsShape for Line
Source§fn contains_rect(&self, rect: &Rect) -> bool
fn contains_rect(&self, rect: &Rect) -> bool
Returns true if
self
contains rect
Source§fn contains_circle(&self, _: &Circle) -> bool
fn contains_circle(&self, _: &Circle) -> bool
Returns true if
self
contains circle
Source§fn contains_line(&self, line: &Line) -> bool
fn contains_line(&self, line: &Line) -> bool
Returns true if
self
contains line
Source§fn contains_triangle(&self, _: &Triangle) -> bool
fn contains_triangle(&self, _: &Triangle) -> bool
Returns true if
self
contains triangle
Source§fn contains_polygon(&self, _: &Polygon) -> bool
fn contains_polygon(&self, _: &Polygon) -> bool
Returns true if
self
contains polygon
Source§impl<'de> Deserialize<'de> for Line
impl<'de> Deserialize<'de> for Line
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Line, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Line, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl IntersectsContains for Line
impl IntersectsContains for Line
Source§impl IntersectsShape for Line
impl IntersectsShape for Line
Source§fn intersects_rect(&self, rect: &Rect) -> bool
fn intersects_rect(&self, rect: &Rect) -> bool
Returns true if
rect
intersects self
Source§fn intersects_circle(&self, circle: &Circle) -> bool
fn intersects_circle(&self, circle: &Circle) -> bool
Returns true if
circle
intersects self
Source§fn intersects_line(&self, line: &Line) -> bool
fn intersects_line(&self, line: &Line) -> bool
Returns true if
line
intersects self
Source§fn intersects_triangle(&self, triangle: &Triangle) -> bool
fn intersects_triangle(&self, triangle: &Triangle) -> bool
Returns true if
triangle
intersects self
Source§fn intersects_ellipse(&self, ellipse: &Ellipse) -> bool
fn intersects_ellipse(&self, ellipse: &Ellipse) -> bool
Returns true if
ellipse
intersects self
Source§fn intersects_polygon(&self, polygon: &Polygon) -> bool
fn intersects_polygon(&self, polygon: &Polygon) -> bool
Returns true if
polygon
intersects self
Source§impl Serialize for Line
impl Serialize for Line
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl Shape for Line
impl Shape for Line
Source§fn top_left(&self) -> Coord
fn top_left(&self) -> Coord
Returns left most point x and lowest y (could be from start
or end
for both)
This doesn’t really make sense for line as it may return (end.x, start.y) for example
Source§fn top_right(&self) -> Coord
fn top_right(&self) -> Coord
Returns right most point x and lowest y (could be from start
or end
for both)
This doesn’t really make sense for line as it may return (start.x, end.y) for example
Source§fn bottom_left(&self) -> Coord
fn bottom_left(&self) -> Coord
Returns left most point x and highest y (could be from start
or end
for both)
This doesn’t really make sense for line as it may return (start.x, end.y) for example
Source§fn bottom_right(&self) -> Coord
fn bottom_right(&self) -> Coord
Returns right most point x and highest y (could be from start
or end
for both)
This doesn’t really make sense for line as it may return (start.x, end.y) for example
Source§fn from_points(points: &[Coord]) -> Line
fn from_points(points: &[Coord]) -> Line
create this shape from a list of points (corners of a shape or tips of a line)
Source§fn outline_pixels(&self) -> Vec<Coord>
fn outline_pixels(&self) -> Vec<Coord>
The coords for drawing the shape outline, the points may be in any order
This should be cached rather than called per frame
Source§fn filled_pixels(&self) -> Vec<Coord>
fn filled_pixels(&self) -> Vec<Coord>
The coords for drawing the filled shape, the points may be in any order
This should be cached rather than called per frame
Source§fn to_shape_box(&self) -> ShapeBox
fn to_shape_box(&self) -> ShapeBox
Convert to ShapeBox, used to store shapes with type (for bulk drawing, etc)
Source§fn translate_by(&self, delta: Coord) -> Selfwhere
Self: Sized,
fn translate_by(&self, delta: Coord) -> Selfwhere
Self: Sized,
change every point by +
delta
Source§fn move_to(&self, point: Coord) -> Selfwhere
Self: Sized,
fn move_to(&self, point: Coord) -> Selfwhere
Self: Sized,
moves the shapes first point to
point
(and changes every other point to match their original distance and angle) Read moreSource§fn move_center_to(&self, point: Coord) -> Selfwhere
Self: Sized,
fn move_center_to(&self, point: Coord) -> Selfwhere
Self: Sized,
Moves the shapes center to
point
(and changes every other point to match their original distance and angle) Read moreSource§fn rotate_around(&self, degrees: isize, point: Coord) -> Selfwhere
Self: Sized,
fn rotate_around(&self, degrees: isize, point: Coord) -> Selfwhere
Self: Sized,
Rotate shape around a point
impl Eq for Line
impl StructuralPartialEq for Line
Auto Trait Implementations§
impl Freeze for Line
impl RefUnwindSafe for Line
impl Send for Line
impl Sync for Line
impl Unpin for Line
impl UnwindSafe for Line
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.