pub enum WebGl2InitError {
CanvasNotFound(String),
CanvasQuery(String),
ContextLookup(String),
ContextUnavailable,
ContextCast,
}Expand description
Why a WebGl2Backend could not be constructed.
WebGL reports context-creation failure by returning null rather than
by throwing, so the three ways it fails, a missing canvas, a
non-matching selector, and a browser with no WebGL 2 support, would
otherwise all collapse into one opaque None.
Variants§
CanvasNotFound(String)
The configured selector matched no element in the document.
CanvasQuery(String)
The selector could not be evaluated, because the document has no body yet or the selector is not valid.
ContextLookup(String)
getContext("webgl2") threw rather than returning None.
getContext("webgl2") returned None, which means the browser
has no WebGL 2 support, or the canvas already holds a context of a
different kind.
ContextCast
A webgl2 context was returned but was not a
WebGL2RenderingContext, which should not be reachable.
Implementations§
Source§impl WebGl2InitError
Implements diagnostic helpers on WebGl2InitError.
impl WebGl2InitError
Implements diagnostic helpers on WebGl2InitError.
Trait Implementations§
Source§impl Clone for WebGl2InitError
impl Clone for WebGl2InitError
Source§impl Debug for WebGl2InitError
impl Debug for WebGl2InitError
Source§impl Display for WebGl2InitError
Implements the formatted message for WebGl2InitError.
impl Display for WebGl2InitError
Implements the formatted message for WebGl2InitError.
impl Eq for WebGl2InitError
Source§impl Error for WebGl2InitError
Registers both WebGL error types as standard Error values.
impl Error for WebGl2InitError
Registers both WebGL error types as standard Error values.
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()