pub struct Line {
pub p0: Point,
pub p1: Point,
}
Expand description
A single line.
Fields§
§p0: Point
The line’s start point.
p1: Point
The line’s end point.
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Line
impl<'de> Deserialize<'de> for Line
source§fn 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
source§impl JsonSchema for Line
impl JsonSchema for Line
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl Mul<Line> for TranslateScale
impl Mul<Line> for TranslateScale
source§impl ParamCurve for Line
impl ParamCurve for Line
source§fn subsegment(&self, range: Range<f64>) -> Line
fn subsegment(&self, range: Range<f64>) -> Line
Get a subsegment of the curve for the given parameter range.
source§fn subdivide(&self) -> (Self, Self)
fn subdivide(&self) -> (Self, Self)
Subdivide into (roughly) halves.
source§impl ParamCurveArclen for Line
impl ParamCurveArclen for Line
source§impl ParamCurveArea for Line
impl ParamCurveArea for Line
source§fn signed_area(&self) -> f64
fn signed_area(&self) -> f64
Compute the signed area under the curve. Read more
source§impl ParamCurveCurvature for Line
impl ParamCurveCurvature for Line
source§impl ParamCurveDeriv for Line
impl ParamCurveDeriv for Line
§type DerivResult = ConstPoint
type DerivResult = ConstPoint
The parametric curve obtained by taking the derivative of this one.
source§fn deriv(&self) -> ConstPoint
fn deriv(&self) -> ConstPoint
The derivative of the curve. Read more
source§impl ParamCurveExtrema for Line
impl ParamCurveExtrema for Line
source§fn extrema_ranges(&self) -> ArrayVec<Range<f64>, { _ }>
fn extrema_ranges(&self) -> ArrayVec<Range<f64>, { _ }>
Return parameter ranges, each of which is monotonic within the range.
source§fn bounding_box(&self) -> Rect
fn bounding_box(&self) -> Rect
The smallest rectangle that encloses the curve in the range (0..1).
source§impl ParamCurveNearest for Line
impl ParamCurveNearest for Line
source§impl PartialEq for Line
impl PartialEq for Line
source§impl Shape for Line
impl Shape for Line
source§fn area(&self) -> f64
fn area(&self) -> f64
Returning zero here is consistent with the contract (area is only meaningful for closed shapes), but an argument can be made that the contract should be tightened to include the Green’s theorem contribution.
§type PathElementsIter<'iter> = LinePathIter
type PathElementsIter<'iter> = LinePathIter
The iterator returned by the
path_elements
method.source§fn path_elements(&self, _tolerance: f64) -> LinePathIter
fn path_elements(&self, _tolerance: f64) -> LinePathIter
source§fn bounding_box(&self) -> Rect
fn bounding_box(&self) -> Rect
The smallest rectangle that encloses the shape.
source§fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter<'_>> ⓘ
fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter<'_>> ⓘ
source§fn as_rounded_rect(&self) -> Option<RoundedRect>
fn as_rounded_rect(&self) -> Option<RoundedRect>
If the shape is a rounded rectangle, make it available.
impl Copy for Line
impl StructuralPartialEq for Line
Auto Trait Implementations§
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