[][src]Struct svg_minimal::Path

pub struct Path { /* fields omitted */ }

Create a path by specifying stroke, stroke-width, fill and rules such as Move To, etc.

Implementations

impl Path[src]

pub fn new() -> Path[src]

pub fn set_stroke_color(&mut self, color: Color)[src]

Sets stroke=\"YourColor\". If unset it will remain as stroke="none".

pub fn set_stroke_width(&mut self, width: usize)[src]

Sets stroke-width=\"YourWidth\". If unset it will remain as stroke-width=\"0\".

pub fn set_fill_color(&mut self, color: Color)[src]

Sets fill="YourColor". If unset it will remain as fill=\"none\".

pub fn move_to(&mut self, pos: [usize; 2])[src]

Adds rule "M x y"

pub fn line_to(&mut self, pos: [usize; 2])[src]

Adds rule "l x y"

pub fn bezier(&mut self, points: [usize; 6])[src]

Adds rule "c x1 y1, x2 y2, x y"

pub fn close_path(&mut self)[src]

Closes the path with 'Z'

pub fn undo(&mut self)[src]

Removes the last rule

pub fn create(&mut self) -> String[src]

Returns a String with a path of type "<path d=\"...\" stroke=\"...\" stroke-width=\"...\" fill=\"...\" />"

pub fn add_rule_raw(&mut self, rule: String)[src]

Adds (for example) "M 0 0 ... L 100 100" to the current path rules

pub fn create_raw(&mut self) -> String[src]

Returns a String with path information. Example: "M 0 0 L 100 100 ..."

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