[]Struct druid::piet::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

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

Create a new line.

Trait Implementations

impl Clone for Line

impl Copy for Line

impl Data for Line[src]

impl Debug for Line

impl From<Line> for PathSeg

impl Mul<Line> for Affine

type Output = Line

The resulting type after applying the * operator.

impl Mul<Line> for TranslateScale

type Output = Line

The resulting type after applying the * operator.

impl ParamCurve for Line

impl ParamCurveArclen for Line

impl ParamCurveArea for Line

impl ParamCurveCurvature for Line

impl ParamCurveDeriv for Line

type DerivResult = ConstPoint

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

impl ParamCurveExtrema for Line

impl ParamCurveNearest for Line

impl PartialEq<Line> for Line

impl Scalable for Line[src]

fn to_px(&self, scale: &Scale) -> Line[src]

Converts a Line from display points into pixels, using the x axis scale factor for x and the y axis scale factor for y.

fn to_dp(&self, scale: &Scale) -> Line[src]

Converts a Line from pixels into display points, using the x axis scale factor for x and the y axis scale factor for y.

impl Shape for Line

type BezPathIter = LinePathIter

The iterator resulting from to_bez_path.

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.

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

Same consideration as area.

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

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

impl<T> AnyEq for T where
    T: PartialEq<T> + Any
[src]

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

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

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

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

impl<T> RoundFrom<T> for T

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

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.