Data

Struct Data 

Source
pub struct Data { /* private fields */ }
Expand description

Represents the data attribute of a svg path

Implementations§

Source§

impl Data

Source

pub fn new() -> Self

a new empty data element

Source

pub fn from_points(points: &[Point]) -> Self

Create the element content from a series of points Note: there must be more than one point for this to do anything.

Source

pub fn move_to(&mut self, p: Point) -> &mut Data

Add a Move To step to this path.

Source

pub fn line_to(&mut self, p: Point) -> &mut Data

Add a line to step to this path

Source

pub fn arc_to<RX, RY, ROT>( &mut self, p: Point, rx: RX, ry: RY, rotation: ROT, large: bool, sweep: bool, ) -> &mut Data
where RX: Display, RY: Display, ROT: Display,

Add an arc to step to this path

Source

pub fn close(&mut self) -> &mut Data

Close the loop of this path.

Source

pub fn build(&self) -> String

Turn this data attribute into a string.

Source

pub fn to_path(&self) -> Element

build a path element using this data attribute

Trait Implementations§

Source§

impl Default for Data

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Data

§

impl RefUnwindSafe for Data

§

impl Send for Data

§

impl Sync for Data

§

impl Unpin for Data

§

impl UnwindSafe for Data

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.