Struct raw_window_handle::WebCanvasWindowHandle
source · #[non_exhaustive]pub struct WebCanvasWindowHandle {
pub obj: NonNull<c_void>,
}
Expand description
Raw window handle for a Web canvas registered via wasm-bindgen
.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.obj: NonNull<c_void>
A pointer to the JsValue
of an HtmlCanvasElement
.
Note: This uses c_void
to avoid depending on wasm-bindgen
directly.
Implementations§
source§impl WebCanvasWindowHandle
impl WebCanvasWindowHandle
sourcepub fn new(obj: NonNull<c_void>) -> Self
pub fn new(obj: NonNull<c_void>) -> Self
Create a new handle from a pointer to HtmlCanvasElement
.
§Example
let canvas: &HtmlCanvasElement;
let value: &JsValue = &canvas; // Deref to `JsValue`
let obj: NonNull<c_void> = NonNull::from(value).cast();
let mut handle = WebCanvasWindowHandle::new(obj);
Trait Implementations§
source§impl Clone for WebCanvasWindowHandle
impl Clone for WebCanvasWindowHandle
source§fn clone(&self) -> WebCanvasWindowHandle
fn clone(&self) -> WebCanvasWindowHandle
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for WebCanvasWindowHandle
impl Debug for WebCanvasWindowHandle
source§impl From<WebCanvasWindowHandle> for RawWindowHandle
impl From<WebCanvasWindowHandle> for RawWindowHandle
source§fn from(value: WebCanvasWindowHandle) -> Self
fn from(value: WebCanvasWindowHandle) -> Self
Converts to this type from the input type.
source§impl Hash for WebCanvasWindowHandle
impl Hash for WebCanvasWindowHandle
source§impl PartialEq for WebCanvasWindowHandle
impl PartialEq for WebCanvasWindowHandle
source§fn eq(&self, other: &WebCanvasWindowHandle) -> bool
fn eq(&self, other: &WebCanvasWindowHandle) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for WebCanvasWindowHandle
impl Eq for WebCanvasWindowHandle
impl StructuralPartialEq for WebCanvasWindowHandle
Auto Trait Implementations§
impl Freeze for WebCanvasWindowHandle
impl RefUnwindSafe for WebCanvasWindowHandle
impl !Send for WebCanvasWindowHandle
impl !Sync for WebCanvasWindowHandle
impl Unpin for WebCanvasWindowHandle
impl UnwindSafe for WebCanvasWindowHandle
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