pub struct SvgOutput<'w> { /* private fields */ }
Expand description
Output to SVG file format!
Implementations§
Source§impl<'w> SvgOutput<'w>
impl<'w> SvgOutput<'w>
Sourcepub fn new(file: &'w mut dyn Write) -> Self
pub fn new(file: &'w mut dyn Write) -> Self
Examples found in repository?
examples/plot.rs (line 15)
8fn main() {
9 simple_logger::init().unwrap();
10
11 let x = vec![1.0, 2.0, 3.0, 4.0, 5.0, 8.0];
12 let y = vec![9.0, 2.2, 5.5, 2.2, 1.2, 1.7];
13
14 let mut buffer = File::create("plot.svg").unwrap();
15 let mut canvas = SvgOutput::new(&mut buffer);
16
17 let size = Size::new(1000.0, 1000.0);
18 plot(&mut canvas, x, y, size);
19}
Trait Implementations§
Auto Trait Implementations§
impl<'w> Freeze for SvgOutput<'w>
impl<'w> !RefUnwindSafe for SvgOutput<'w>
impl<'w> !Send for SvgOutput<'w>
impl<'w> !Sync for SvgOutput<'w>
impl<'w> Unpin for SvgOutput<'w>
impl<'w> !UnwindSafe for SvgOutput<'w>
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