[][src]Struct kurbo::Line

pub struct Line {
    pub p0: Point,
    pub p1: Point,
}

A single line.

Fields

p0: Point

The line's start point.

p1: Point

The line's end point.

Implementations

impl Line[src]

pub fn new(p0: impl Into<Point>, p1: impl Into<Point>) -> Line[src]

Create a new line.

Trait Implementations

impl Clone for Line[src]

impl Copy for Line[src]

impl Debug for Line[src]

impl<'de> Deserialize<'de> for Line[src]

impl From<Line> for PathSeg[src]

impl Mul<Line> for Affine[src]

type Output = Line

The resulting type after applying the * operator.

impl Mul<Line> for TranslateScale[src]

type Output = Line

The resulting type after applying the * operator.

impl ParamCurve for Line[src]

impl ParamCurveArclen for Line[src]

impl ParamCurveArea for Line[src]

impl ParamCurveCurvature for Line[src]

impl ParamCurveDeriv for Line[src]

type DerivResult = ConstPoint

The parametric curve obtained by taking the derivative of this one.

impl ParamCurveExtrema for Line[src]

impl ParamCurveNearest for Line[src]

impl PartialEq<Line> for Line[src]

impl Serialize for Line[src]

impl Shape for Line[src]

type BezPathIter = LinePathIter

The iterator resulting from to_bez_path.

fn area(&self) -> f64[src]

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.

fn winding(&self, _pt: Point) -> i32[src]

Same consideration as area.

impl StructuralPartialEq for Line[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.