MCPcopy Create free account
hub / github.com/DioxusLabs/anyrender / fmt

Method fmt

crates/wgpu_context/src/error.rs:30–53  ·  view source on GitHub ↗
(&self, f: &mut std::fmt::Formatter<'_>)

Source from the content-addressed store, hash-verified

28
29impl Display for WgpuContextError {
30 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
31 match self {
32 Self::NoCompatibleDevice => writeln!(f, "Couldn't find suitable device"),
33 Self::WgpuCreateSurfaceError(inner) => {
34 writeln!(f, "Couldn't create wgpu surface")?;
35 inner.fmt(f)
36 }
37 Self::UnsupportedSurfaceFormat => {
38 writeln!(
39 f,
40 "Couldn't find `Rgba8Unorm` or `Bgra8Unorm` texture formats for surface"
41 )
42 }
43 Self::RequestAdapterError(inner) => {
44 writeln!(f, "Couldn't request an adapter: {:#}", inner)
45 }
46 Self::RequestDeviceError(inner) => {
47 writeln!(f, "Couldn't request a device: {:#}", inner)
48 }
49 Self::PollError(inner) => {
50 writeln!(f, "Couldn't poll a device: {:#}", inner)
51 }
52 }
53 }
54}
55
56impl Error for WgpuContextError {}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected