pub struct LevelId {
pub section: u16,
pub number: u16,
}Expand description
The stable identifier of a level: section.number, such as 1.4 or 10.4.
Identifiers are explicit and never renumbered, so saved games keep working when levels
are reordered and the gap at 1.11 stays. Ordering is numeric on (section, number):
1.12 sorts after 1.10, which string comparison would get wrong.
Fields§
§section: u16The section number; 0 is the game introduction.
number: u16The level number within the section; 0 is the section intro.
Implementations§
Trait Implementations§
impl Copy for LevelId
impl Eq for LevelId
Source§impl FromStr for LevelId
impl FromStr for LevelId
Source§fn from_str(value: &str) -> Result<Self, Self::Err>
fn from_str(value: &str) -> Result<Self, Self::Err>
Parse S.N where both parts are non-empty ASCII digit strings. Like the Python
parse_level_id, leading zeros are accepted ("01.002" is 1.2); anything else,
including "1.2.3", "1." and signs, is an error.
Source§type Err = ParseLevelIdError
type Err = ParseLevelIdError
The associated error which can be returned from parsing.
Source§impl Ord for LevelId
impl Ord for LevelId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for LevelId
impl PartialOrd for LevelId
impl StructuralPartialEq for LevelId
Auto Trait Implementations§
impl Freeze for LevelId
impl RefUnwindSafe for LevelId
impl Send for LevelId
impl Sync for LevelId
impl Unpin for LevelId
impl UnsafeUnpin for LevelId
impl UnwindSafe for LevelId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.