pub(crate) type WebGLRenderingContextOrWebGL2RenderingContext = WebGLRenderingContextOrWebGL2RenderingContext<DomTypeHolder>;
Aliased Type§
enum WebGLRenderingContextOrWebGL2RenderingContext {
WebGLRenderingContext(Root<Dom<WebGLRenderingContext>>),
WebGL2RenderingContext(Root<Dom<WebGL2RenderingContext>>),
}
Variants§
WebGLRenderingContext(Root<Dom<WebGLRenderingContext>>)
WebGL2RenderingContext(Root<Dom<WebGL2RenderingContext>>)
Implementations
Source§impl<D: DomTypes> WebGLRenderingContextOrWebGL2RenderingContext<D>
impl<D: DomTypes> WebGLRenderingContextOrWebGL2RenderingContext<D>
unsafe fn TryConvertToWebGLRenderingContext( cx: SafeJSContext, value: HandleValue<'_>, ) -> Result<Option<DomRoot<D::WebGLRenderingContext>>, ()>
unsafe fn TryConvertToWebGL2RenderingContext( cx: SafeJSContext, value: HandleValue<'_>, ) -> Result<Option<DomRoot<D::WebGL2RenderingContext>>, ()>
Trait Implementations
Source§impl<D: DomTypes> FromJSValConvertible for WebGLRenderingContextOrWebGL2RenderingContext<D>
impl<D: DomTypes> FromJSValConvertible for WebGLRenderingContextOrWebGL2RenderingContext<D>
Source§unsafe fn from_jsval(
cx: *mut JSContext,
value: HandleValue<'_>,
_option: (),
) -> Result<ConversionResult<WebGLRenderingContextOrWebGL2RenderingContext<D>>, ()>
unsafe fn from_jsval( cx: *mut JSContext, value: HandleValue<'_>, _option: (), ) -> Result<ConversionResult<WebGLRenderingContextOrWebGL2RenderingContext<D>>, ()>
Convert
val
to type Self
.
Optional configuration of type T
can be passed as the option
argument.
If it returns Err(())
, a JSAPI exception is pending.
If it returns Ok(Failure(reason))
, there is no pending JSAPI exception.