pub enum SurfaceError {
OutOfDate,
Lost,
Timeout,
Hal(HalError),
}Expand description
A surface or swapchain operation failed.
Split out from HalError because the frame loop must handle
SurfaceError::OutOfDate as a normal event: every resize produces one, and
a caller that treats it as fatal has a bug that only appears when someone
drags a window edge.
Variants§
OutOfDate
The swapchain no longer matches the surface — the window resized, the
canvas changed size, or the display mode changed. Reconfigure with
Device::reconfigure_swapchain
and try again next frame.
This is expected traffic, not an error condition.
Lost
The surface is gone — the window was destroyed, or the compositor dropped the connection. Not recoverable by reconfiguring.
Timeout
Acquire timed out with no image available.
Backends with an implicit acquire (WebGPU’s getCurrentTexture) never
produce this.
Hal(HalError)
A general failure underneath.
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
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()