#[non_exhaustive]pub enum SurfaceError {
NotReady,
FrameInFlight,
NoFrame,
BufferTooSmall {
required: usize,
actual: usize,
},
CursorTooLarge {
limit: Size,
requested: Size,
},
Backend(Box<dyn Error + Send + Sync + 'static>),
}Expand description
Failures from Surface.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotReady
The surface has no valid size yet, or is not currently displayable.
FrameInFlight
Surface::acquire was called twice without an intervening present.
NoFrame
Surface::present was called without a preceding acquire.
BufferTooSmall
The backend handed over a buffer too small for the geometry it declared.
CursorTooLarge
A cursor sprite larger than the plane can hold.
Cursor planes are fixed-size, so this is a limit rather than a shortage. Refused rather than cropped: a pointer missing its lower half reads as a rendering bug, not as a hardware constraint.
Fields
Backend(Box<dyn Error + Send + Sync + 'static>)
A platform-specific failure.
Implementations§
Source§impl SurfaceError
impl SurfaceError
Sourcepub fn backend<E: Error + Send + Sync + 'static>(err: E) -> Self
pub fn backend<E: Error + Send + Sync + 'static>(err: E) -> Self
Wraps a platform error without leaking its type into the core.
Sourcepub fn backend_msg(err: impl Display) -> Self
pub fn backend_msg(err: impl Display) -> Self
Wraps a platform error that is not Send + Sync, keeping only its message.
SurfaceError is deliberately thread-safe so applications can put it in
an anyhow::Error or return it from main. Some platform errors are not —
softbuffer’s, for one — so they get flattened to text here rather than
infecting every caller.
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()