#[non_exhaustive]pub enum SurfaceError {
Init(String),
Present(String),
}Expand description
A failure creating or driving the GL context/surface.
Both the native (glutin) and wasm (WebGL2) context modules produce this. It is string-backed
rather than a structured enum because the two platforms surface very different underlying error
types (glutin’s glutin::error::Error vs. a web_sys JsValue), and the caller
(retroglyph_window’s event loop) only needs a message plus the recoverable/fatal signal
from RecoverableError.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Init(String)
Creating the GL display, config, context, or surface failed. Treated as fatal (not recoverable): a game cannot proceed without a context, and retrying the same creation path is very unlikely to succeed.
Present(String)
Presenting a frame failed (buffer swap on native, or the WebGL2 context was lost on wasm). Treated as potentially recoverable so the event loop’s consecutive-failure heuristic can retry before giving up.
Trait Implementations§
Source§impl Debug for SurfaceError
impl Debug for SurfaceError
Source§impl Display for SurfaceError
impl Display for SurfaceError
Source§impl Error for SurfaceError
impl Error for SurfaceError
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()
Source§impl RecoverableError for SurfaceError
impl RecoverableError for SurfaceError
Source§fn is_recoverable(&self) -> bool
fn is_recoverable(&self) -> bool
Auto Trait Implementations§
impl Freeze for SurfaceError
impl RefUnwindSafe for SurfaceError
impl Send for SurfaceError
impl Sync for SurfaceError
impl Unpin for SurfaceError
impl UnsafeUnpin for SurfaceError
impl UnwindSafe for SurfaceError
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.