#[non_exhaustive]pub enum GenericSurfaceError {
Init(String),
Present(String),
}Expand description
A ready-made, string-backed SurfaceError for presenters whose
underlying surface library reports failures as opaque strings rather than a structured error
enum.
Several presenter backends (e.g. retroglyph-gl’s native/wasm split, or a future softbuffer
backend) need only two buckets (“surface/context creation failed” (fatal) and “presenting a
frame failed” (potentially recoverable)) and would otherwise each hand-roll the same enum { Init(String), Present(String) } plus RecoverableError impl. This type is that common
shape, provided once here so backends can reuse it directly instead of duplicating it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Init(String)
Creating the surface or its underlying context failed. Treated as fatal (not recoverable): a presenter cannot proceed without a surface, and retrying the same creation path is very unlikely to succeed.
Present(String)
Presenting a frame failed. Treated as potentially recoverable so the event loop’s consecutive-failure heuristic can retry before giving up.
Trait Implementations§
Source§impl Debug for GenericSurfaceError
impl Debug for GenericSurfaceError
Source§impl Display for GenericSurfaceError
impl Display for GenericSurfaceError
Source§impl Error for GenericSurfaceError
impl Error for GenericSurfaceError
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 GenericSurfaceError
impl RecoverableError for GenericSurfaceError
Source§fn is_recoverable(&self) -> bool
fn is_recoverable(&self) -> bool
Auto Trait Implementations§
impl Freeze for GenericSurfaceError
impl RefUnwindSafe for GenericSurfaceError
impl Send for GenericSurfaceError
impl Sync for GenericSurfaceError
impl Unpin for GenericSurfaceError
impl UnsafeUnpin for GenericSurfaceError
impl UnwindSafe for GenericSurfaceError
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.