#[non_exhaustive]pub enum LevelError {
BadName {
name: String,
},
Load {
path: String,
error: AssetError,
},
Tileset {
atlas: String,
sprite: String,
reason: &'static str,
},
Clips {
atlas: String,
error: ClipError,
},
UnknownLayer {
name: String,
},
Prefab(PrefabError),
}Expand description
Why a level could not be loaded. The previous level is gone then, and
nothing of the new one is in the world but the prefabs it read, which
the PrefabLibrary keeps.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
BadName
The name is not a level’s: lowercase letters, digits and _, as the
cook names level files.
Load
The level file, or an atlas of its tile sets, could not be loaded.
Tileset
A tile set of the level is not a tile set of its atlas, or not of the level’s size.
Fields
Clips
The clips of an atlas of the level could not be added.
UnknownLayer
The level’s grid is on a collision layer the game has not named
(App::collision_layers).
Prefab(PrefabError)
A prefab of the level’s entities could not be loaded, or an entity could not be spawned.
Trait Implementations§
Source§impl Clone for LevelError
impl Clone for LevelError
Source§impl Debug for LevelError
impl Debug for LevelError
Source§impl Display for LevelError
impl Display for LevelError
Source§impl Error for LevelError
impl Error for LevelError
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 LevelError
impl PartialEq for LevelError
impl StructuralPartialEq for LevelError
Auto Trait Implementations§
impl Forget for LevelError
impl Freeze for LevelError
impl Move for LevelError
impl RefUnwindSafe for LevelError
impl Send for LevelError
impl Sync for LevelError
impl Unpin for LevelError
impl UnsafeUnpin for LevelError
impl UnwindSafe for LevelError
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