Struct wgpu::rwh::WebWindowHandle
source · #[non_exhaustive]pub struct WebWindowHandle {
pub id: u32,
}
Expand description
Raw window handle for the Web.
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.id: u32
An ID value inserted into the data attributes of the canvas element as ‘raw-handle
’.
When accessing from JS, the attribute will automatically be called rawHandle
.
Each canvas created by the windowing system should be assigned their own unique ID.
Implementations§
source§impl WebWindowHandle
impl WebWindowHandle
sourcepub fn new(id: u32) -> WebWindowHandle
pub fn new(id: u32) -> WebWindowHandle
Create a new handle to a canvas element.
Example
let id: u32 = 0; // canvas.rawHandle;
let handle = WebWindowHandle::new(id);
Trait Implementations§
source§impl Clone for WebWindowHandle
impl Clone for WebWindowHandle
source§fn clone(&self) -> WebWindowHandle
fn clone(&self) -> WebWindowHandle
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 WebWindowHandle
impl Debug for WebWindowHandle
source§impl From<WebWindowHandle> for RawWindowHandle
impl From<WebWindowHandle> for RawWindowHandle
source§fn from(value: WebWindowHandle) -> RawWindowHandle
fn from(value: WebWindowHandle) -> RawWindowHandle
Converts to this type from the input type.
source§impl Hash for WebWindowHandle
impl Hash for WebWindowHandle
source§impl PartialEq for WebWindowHandle
impl PartialEq for WebWindowHandle
source§fn eq(&self, other: &WebWindowHandle) -> bool
fn eq(&self, other: &WebWindowHandle) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for WebWindowHandle
impl Eq for WebWindowHandle
impl StructuralEq for WebWindowHandle
impl StructuralPartialEq for WebWindowHandle
Auto Trait Implementations§
impl RefUnwindSafe for WebWindowHandle
impl Send for WebWindowHandle
impl Sync for WebWindowHandle
impl Unpin for WebWindowHandle
impl UnwindSafe for WebWindowHandle
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.