pub enum ResourceLoadError {
Missing {
key: ResourceKey,
path: String,
required: bool,
},
InvalidUtf8 {
key: ResourceKey,
path: String,
required: bool,
details: String,
},
Parse {
key: ResourceKey,
path: String,
required: bool,
details: String,
},
Load {
key: ResourceKey,
path: String,
required: bool,
details: String,
},
}Expand description
Canonical resource-load failure categories shared across managers.
Variants§
Missing
A required resource was not present.
InvalidUtf8
Resource bytes were not valid UTF-8.
Parse
Resource content failed Fluent parsing.
Load
Resource loading failed in the host asset pipeline.
Implementations§
Source§impl ResourceLoadError
impl ResourceLoadError
Sourcepub fn missing(spec: &ModuleResourceSpec) -> Self
pub fn missing(spec: &ModuleResourceSpec) -> Self
Constructs a missing-file error for a resource spec.
Sourcepub fn load(spec: &ModuleResourceSpec, details: impl Into<String>) -> Self
pub fn load(spec: &ModuleResourceSpec, details: impl Into<String>) -> Self
Constructs an asset-pipeline load error for a resource spec.
Sourcepub fn key(&self) -> &ResourceKey
pub fn key(&self) -> &ResourceKey
Returns the key associated with this failure.
Sourcepub fn is_required(&self) -> bool
pub fn is_required(&self) -> bool
Returns true when this failure affects required readiness.
Trait Implementations§
Source§impl Clone for ResourceLoadError
impl Clone for ResourceLoadError
Source§fn clone(&self) -> ResourceLoadError
fn clone(&self) -> ResourceLoadError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResourceLoadError
impl Debug for ResourceLoadError
Source§impl Display for ResourceLoadError
impl Display for ResourceLoadError
Source§impl Error for ResourceLoadError
impl Error for ResourceLoadError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for ResourceLoadError
impl PartialEq for ResourceLoadError
impl Eq for ResourceLoadError
impl StructuralPartialEq for ResourceLoadError
Auto Trait Implementations§
impl Freeze for ResourceLoadError
impl RefUnwindSafe for ResourceLoadError
impl Send for ResourceLoadError
impl Sync for ResourceLoadError
impl Unpin for ResourceLoadError
impl UnsafeUnpin for ResourceLoadError
impl UnwindSafe for ResourceLoadError
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
Mutably borrows from an owned value. Read more