#[non_exhaustive]pub enum Error {
Show 17 variants
Io {
path: PathBuf,
source: Error,
},
Json {
path: Option<PathBuf>,
source: Error,
},
Image {
path: PathBuf,
reason: String,
},
Rgbe {
reason: String,
},
Ktx2 {
reason: String,
},
Lut {
loader: &'static str,
reason: String,
},
UnsupportedFormat {
what: &'static str,
value: String,
},
UnsupportedTextureType {
what: &'static str,
texture_type: TextureType,
},
Gltf(GltfError),
NoKeyframes {
track: String,
},
UnsupportedTrackType {
name: String,
},
UnsupportedInterpolation {
value_type: &'static str,
track: String,
},
TrackName(ParseTrackNameError),
NoAdapter {
wanted: Option<String>,
},
Device(RequestDeviceError),
Readback {
reason: String,
},
Unsupported {
field: &'static str,
kind: MaterialKind,
},
}Expand description
Everything the public API of three-rs can fail with.
Non-exhaustive: new variants are added as more of the port’s surface stops
panicking, and matching code should carry a _ arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io
A file a loader was pointed at could not be read.
Json
A JSON document could not be parsed. path is None when the caller
handed the JSON over directly, as BufferGeometryLoader::parse does.
Fields
Image
An image file the decoder rejected.
Rgbe
A Radiance RGBE (.hdr) file the decoder rejected. reason is
three.js’ own rgbe_error() message, less its THREE.HDRLoader:
prefix.
Ktx2
A KTX 2.0 file KTX2Loader rejected, or one it cannot transcode for
this device. reason is three.js’ own message, less its
THREE.KTX2Loader: prefix.
Lut
A colour lookup table LUTCubeLoader, LUT3dlLoader or
LUTImageLoader rejected. loader is the three.js class name and
reason its own message, less the THREE.<loader>: prefix.
Fields
UnsupportedFormat
A file names a type, format or encoding this port does not implement.
what says which field it was read from.
UnsupportedTextureType
A texture type that is not a legal depth format (gpu_format) or not a
legal colour format (color_gpu_format).
Fields
texture_type: TextureTypeThe texture type that failed it.
Gltf(GltfError)
A glTF asset the loader could not make sense of.
NoKeyframes
new KeyframeTrack() with an empty times array.
UnsupportedTrackType
A track type name that no KeyframeTrack subclass answers to.
UnsupportedInterpolation
An interpolation mode this track’s value type does not support, where the value type’s own default does not support it either.
Fields
TrackName(ParseTrackNameError)
A track name PropertyBinding cannot parse.
NoAdapter
No adapter to render on — no Vulkan device natively, or
navigator.gpu.requestAdapter() resolving to null in a browser.
wanted is the THREE_RS_ADAPTER_NAME filter, when one was set and
matched nothing; it is always None on wasm32, where the browser picks
the adapter and there is nothing to filter.
Device(RequestDeviceError)
adapter.request_device() failed.
Readback
Reading pixels back off the GPU failed; reason is what wgpu said.
Unsupported
A material field that is set but that no part of the port reads for
this kind of material — see
MeshBasicNodeMaterial::check_supported
and the audit in docs/api.md. field is the three.js name.
Fields
kind: MaterialKindThe material kind it was set on.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()