Trait tagger::WriteAttr[][src]

pub trait WriteAttr: Write + Sized {
    fn polyline_data<F>(&mut self, func: F) -> Result<&mut Self, Error>
    where
        F: FnOnce(&'x mut PolyLineBuilder<'y, Self>) -> Result<&'x mut PolyLineBuilder<'y, Self>, Error>
, { ... }
fn path_data<F>(&mut self, func: F) -> Result<&mut Self, Error>
    where
        F: FnOnce(&'x mut PathBuilder<'y, Self>) -> Result<&'x mut PathBuilder<'y, Self>, Error>
, { ... }
fn with_attr(
        &mut self,
        s: &str,
        func: impl FnOnce(&mut Self) -> Result
    ) -> Result<&mut Self, Error> { ... }
fn attr(&mut self, s: &str, val: impl Display) -> Result<&mut Self, Error> { ... } }

Functions the user can call to add attributes. AttributeWriter could have implemented these, but lets use a trait to simplify lifetimes.

Provided methods

fn polyline_data<F>(&mut self, func: F) -> Result<&mut Self, Error> where
    F: FnOnce(&'x mut PolyLineBuilder<'y, Self>) -> Result<&'x mut PolyLineBuilder<'y, Self>, Error>, 
[src]

Write the data attribute for a svg polyline.

fn path_data<F>(&mut self, func: F) -> Result<&mut Self, Error> where
    F: FnOnce(&'x mut PathBuilder<'y, Self>) -> Result<&'x mut PathBuilder<'y, Self>, Error>, 
[src]

Write the data attribute for a svg path.

fn with_attr(
    &mut self,
    s: &str,
    func: impl FnOnce(&mut Self) -> Result
) -> Result<&mut Self, Error>
[src]

Write an attribute where the user can write the value part using wr macro or the write macro

fn attr(&mut self, s: &str, val: impl Display) -> Result<&mut Self, Error>[src]

Write an attribute with the specified tag and value using the values fmt::Display trait.

Loading content...

Implementors

impl<'a, T: Write> WriteAttr for AttributeWriter<'a, T>[src]

Loading content...