pub struct BrowserCapabilities {
pub secure_context: bool,
pub wasm: bool,
pub webgl2: bool,
pub webgpu: bool,
pub immersive_ar: bool,
pub immersive_vr: bool,
pub webgl_error: Option<String>,
pub xr_error: Option<String>,
}Expand description
Observed browser APIs and support queries, not permission grants or hardware proof.
wasm-bindgen generates the JavaScript getters and TypeScript declaration from these Rust fields. Browser hosts must free the returned owned snapshot.
Fields§
§secure_context: boolWhether the browser considers this a secure context.
wasm: boolWhether the WebAssembly object is present.
webgl2: boolWhether a temporary WebGL 2 context could be created.
webgpu: boolWhether navigator.gpu is present; no adapter or device was requested.
immersive_ar: boolResult of isSessionSupported("immersive-ar").
immersive_vr: boolResult of isSessionSupported("immersive-vr").
webgl_error: Option<String>Diagnostic when the WebGL probe failed rather than returning no context.
xr_error: Option<String>Diagnostics for rejected or malformed XR support queries, with mode labels.
Trait Implementations§
Source§impl Clone for BrowserCapabilities
impl Clone for BrowserCapabilities
Source§fn clone(&self) -> BrowserCapabilities
fn clone(&self) -> BrowserCapabilities
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 BrowserCapabilities
impl Debug for BrowserCapabilities
Source§impl Default for BrowserCapabilities
impl Default for BrowserCapabilities
Source§fn default() -> BrowserCapabilities
fn default() -> BrowserCapabilities
Returns the “default value” for a type. Read more
impl Eq for BrowserCapabilities
Source§impl From<BrowserCapabilities> for JsValue
impl From<BrowserCapabilities> for JsValue
Source§fn from(value: BrowserCapabilities) -> Self
fn from(value: BrowserCapabilities) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for BrowserCapabilities
impl FromWasmAbi for BrowserCapabilities
Source§impl IntoWasmAbi for BrowserCapabilities
impl IntoWasmAbi for BrowserCapabilities
Source§impl LongRefFromWasmAbi for BrowserCapabilities
impl LongRefFromWasmAbi for BrowserCapabilities
Source§type Abi = WasmPtr<WasmRefCell<BrowserCapabilities>>
type Abi = WasmPtr<WasmRefCell<BrowserCapabilities>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRef<BrowserCapabilities>
type Anchor = RcRef<BrowserCapabilities>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiSource§impl PartialEq for BrowserCapabilities
impl PartialEq for BrowserCapabilities
Source§fn eq(&self, other: &BrowserCapabilities) -> bool
fn eq(&self, other: &BrowserCapabilities) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl RefFromWasmAbi for BrowserCapabilities
impl RefFromWasmAbi for BrowserCapabilities
Source§type Abi = WasmPtr<WasmRefCell<BrowserCapabilities>>
type Abi = WasmPtr<WasmRefCell<BrowserCapabilities>>
The Wasm ABI type references to
Self are recovered from.Source§type Anchor = RcRef<BrowserCapabilities>
type Anchor = RcRef<BrowserCapabilities>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl RefMutFromWasmAbi for BrowserCapabilities
impl RefMutFromWasmAbi for BrowserCapabilities
Source§type Abi = WasmPtr<WasmRefCell<BrowserCapabilities>>
type Abi = WasmPtr<WasmRefCell<BrowserCapabilities>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRefMut<BrowserCapabilities>
type Anchor = RcRefMut<BrowserCapabilities>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiimpl StructuralPartialEq for BrowserCapabilities
impl SupportsConstructor for BrowserCapabilities
impl SupportsInstanceProperty for BrowserCapabilities
impl SupportsStaticProperty for BrowserCapabilities
Source§impl TryFromJsValue for BrowserCapabilities
impl TryFromJsValue for BrowserCapabilities
Source§impl VectorFromWasmAbi for BrowserCapabilities
impl VectorFromWasmAbi for BrowserCapabilities
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[BrowserCapabilities]>
Source§impl VectorIntoWasmAbi for BrowserCapabilities
impl VectorIntoWasmAbi for BrowserCapabilities
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[BrowserCapabilities]>) -> Self::Abi
Source§impl WasmDescribeVector for BrowserCapabilities
impl WasmDescribeVector for BrowserCapabilities
Auto Trait Implementations§
impl Freeze for BrowserCapabilities
impl RefUnwindSafe for BrowserCapabilities
impl Send for BrowserCapabilities
impl Sync for BrowserCapabilities
impl Unpin for BrowserCapabilities
impl UnsafeUnpin for BrowserCapabilities
impl UnwindSafe for BrowserCapabilities
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§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.