pub struct Canvas {
pub width: usize,
pub height: usize,
pub file_path: String,
pub tags: Vec<String>,
}Fields§
§width: usize§height: usize§file_path: StringImplementations§
Source§impl Canvas
impl Canvas
pub fn new(file_path: String, size: (usize, usize)) -> Self
pub fn write(&self)
pub fn polyloop( &mut self, vtx2xy: &[f32], transform_xy2pix: &[f32; 9], stroke_color: Option<i32>, stroke_width: Option<f32>, fill: Option<i32>, )
pub fn circle( &mut self, x: f32, y: f32, transform_xy2pix: &[f32; 9], radius: f32, color: &str, )
pub fn line( &mut self, x1: f32, y1: f32, x2: f32, y2: f32, transform_xy2pix: &[f32; 9], stroke_width: Option<f32>, )
Auto Trait Implementations§
impl Freeze for Canvas
impl RefUnwindSafe for Canvas
impl Send for Canvas
impl Sync for Canvas
impl Unpin for Canvas
impl UnwindSafe for Canvas
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