Struct tiny_skia::Path[][src]

pub struct Path { /* fields omitted */ }

A Bezier path.

Can be created via PathBuilder. Where PathBuilder can be created from the Path using clear to reuse the allocation.

Guarantees

  • Has a valid, precomputed bounds.
  • All points are finite.
  • Has at least two segments.
  • Each contour starts with a MoveTo.
  • No duplicated Move.
  • No duplicated Close.
  • Zero-length contours are allowed.

Implementations

impl Path[src]

pub fn len(&self) -> usize[src]

Returns the number of segments in the path.

pub fn is_empty(&self) -> bool[src]

Checks if path is empty.

pub fn bounds(&self) -> Rect[src]

Returns the bounds of the path’s points.

The value is already calculated.

pub fn transform(self, ts: Transform) -> Option<Self>[src]

Returns a transformed in-place path.

Some points may become NaN/inf therefore this method can fail.

pub fn segments(&self) -> PathSegmentsIter<'_>

Notable traits for PathSegmentsIter<'a>

impl<'a> Iterator for PathSegmentsIter<'a> type Item = PathSegment;
[src]

Returns an iterator over path’s segments.

pub fn clear(self) -> PathBuilder[src]

Clears the path and returns a PathBuilder that will reuse an allocated memory.

Trait Implementations

impl Clone for Path[src]

impl Debug for Path[src]

impl PartialEq<Path> for Path[src]

impl StructuralPartialEq for Path[src]

Auto Trait Implementations

impl RefUnwindSafe for Path

impl Send for Path

impl Sync for Path

impl Unpin for Path

impl UnwindSafe for Path

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> 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.