pub struct Instance { /* private fields */ }Expand description
the browser’s WebGPU; adapter and device come asynchronously (prepare)
Implementations§
Source§impl Instance
impl Instance
Sourcepub fn new() -> Result<Instance>
pub fn new() -> Result<Instance>
the browser’s WebGPU, adapter and device asked for (prepare says when they are there)
Sourcepub fn with(_desc: &InstanceDesc<'_>) -> Result<Instance>
pub fn with(_desc: &InstanceDesc<'_>) -> Result<Instance>
(app_name and validate mean nothing here: the browser validates every call)
Sourcepub fn prepare(&self) -> Result<bool>
pub fn prepare(&self) -> Result<bool>
have the browser’s adapter and device arrived? Never waits; a worker gets them by returning to the browser’s event loop. (true at once on the other targets.)
pub fn validating(&self) -> bool
pub fn adapter(&self) -> Result<Adapter>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Instance
impl !Send for Instance
impl !Sync for Instance
impl !UnwindSafe for Instance
impl Forget for Instance
impl Freeze for Instance
impl Unpin for Instance
impl UnsafeUnpin for Instance
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