#[non_exhaustive]pub struct WebOffscreenCanvasWindowHandle {
pub obj: NonNull<c_void>,
}
Expand description
Raw window handle for a Web offscreen 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 OffscreenCanvas
.
Note: This uses c_void
to avoid depending on wasm-bindgen
directly.
Implementations§
source§impl WebOffscreenCanvasWindowHandle
impl WebOffscreenCanvasWindowHandle
sourcepub fn new(obj: NonNull<c_void>) -> Self
pub fn new(obj: NonNull<c_void>) -> Self
Create a new handle from a pointer to an OffscreenCanvas
.
§Example
let canvas: &OffscreenCanvas;
let value: &JsValue = &canvas; // Deref to `JsValue`
let obj: NonNull<c_void> = NonNull::from(value).cast();
let mut handle = WebOffscreenCanvasWindowHandle::new(obj);
Trait Implementations§
source§impl Clone for WebOffscreenCanvasWindowHandle
impl Clone for WebOffscreenCanvasWindowHandle
source§fn clone(&self) -> WebOffscreenCanvasWindowHandle
fn clone(&self) -> WebOffscreenCanvasWindowHandle
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 From<WebOffscreenCanvasWindowHandle> for RawWindowHandle
impl From<WebOffscreenCanvasWindowHandle> for RawWindowHandle
source§fn from(value: WebOffscreenCanvasWindowHandle) -> Self
fn from(value: WebOffscreenCanvasWindowHandle) -> Self
Converts to this type from the input type.
source§impl PartialEq for WebOffscreenCanvasWindowHandle
impl PartialEq for WebOffscreenCanvasWindowHandle
source§fn eq(&self, other: &WebOffscreenCanvasWindowHandle) -> bool
fn eq(&self, other: &WebOffscreenCanvasWindowHandle) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for WebOffscreenCanvasWindowHandle
impl Eq for WebOffscreenCanvasWindowHandle
impl StructuralPartialEq for WebOffscreenCanvasWindowHandle
Auto Trait Implementations§
impl Freeze for WebOffscreenCanvasWindowHandle
impl RefUnwindSafe for WebOffscreenCanvasWindowHandle
impl !Send for WebOffscreenCanvasWindowHandle
impl !Sync for WebOffscreenCanvasWindowHandle
impl Unpin for WebOffscreenCanvasWindowHandle
impl UnwindSafe for WebOffscreenCanvasWindowHandle
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