#[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
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)