pub struct SvgWriter { /* private fields */ }Expand description
SVG writer.
Implementations§
Source§impl SvgWriter
impl SvgWriter
Sourcepub fn new_canvas(
writer: Box<dyn Write>,
size: Option<Size2>,
content_rect: Rect,
scale: Option<Scalar>,
) -> Result<Self>
pub fn new_canvas( writer: Box<dyn Write>, size: Option<Size2>, content_rect: Rect, scale: Option<Scalar>, ) -> Result<Self>
Create new SvgWriter
§Arguments
w: Output writersize: Size of the canvas.scale: Scale of the output
Sourcepub fn with_indent(&mut self, s: &str) -> Result<()>
pub fn with_indent(&mut self, s: &str) -> Result<()>
Write something into the SVG and consider indentation.
Sourcepub fn tag(&mut self, tag: &str, attr: &SvgTagAttributes) -> Result<()>
pub fn tag(&mut self, tag: &str, attr: &SvgTagAttributes) -> Result<()>
Write a single tag <tag>.
Sourcepub fn begin_group(&mut self, attr: &SvgTagAttributes) -> Result<()>
pub fn begin_group(&mut self, attr: &SvgTagAttributes) -> Result<()>
Begin a new group <g>.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SvgWriter
impl !RefUnwindSafe for SvgWriter
impl !Send for SvgWriter
impl !Sync for SvgWriter
impl Unpin for SvgWriter
impl !UnwindSafe for SvgWriter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more