pub struct Canvas { /* private fields */ }
Implementations§
Source§impl Canvas
impl Canvas
pub fn new_from_id(canvas_id: &str) -> Option<Canvas>
pub fn get_rendering_context_2d(&self) -> &CanvasRenderingContext2d
pub fn width(&self) -> usize
pub fn set_width(&self, value: usize)
pub fn height(&self) -> usize
pub fn set_height(&self, value: usize)
pub fn get_image_data(&self, x: u32, y: u32, width: u32, height: u32) -> Vec<u8> ⓘ
pub fn get_image_data_as_color_image( &self, x: u32, y: u32, width: u32, height: u32, ) -> ColorImage
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