Struct bellframe::Stage [−][src]
#[repr(transparent)]pub struct Stage(_);
Expand description
A newtype over usize that represents a stage.
To create a new Stage, you can either create it directly by using Stage::from(usize) or use
a constant for the human name for each Stage:
use bellframe::Stage; // Converting from numbers is the same as using the constants assert_eq!(Stage::SINGLES, Stage::from(3)); assert_eq!(Stage::MAJOR, Stage::from(8)); assert_eq!(Stage::CINQUES, Stage::from(11)); assert_eq!(Stage::SIXTEEN, Stage::from(16)); // We can use `Stage::from` to generate `Stage`s that don't have names assert_eq!(Stage::from(2).as_usize(), 2); assert_eq!(Stage::from(100).as_usize(), 100);
Stages with names will also be Displayed as their names:
assert_eq!(&format!("{}", Stage::MAXIMUS), "Maximus"); assert_eq!(&format!("{}", Stage::from(9)), "Caters");
Implementations
Creates a Stage from the lower case version of the human-friendly name (e.g.
"royal", "triples" or "twenty-two").
User-friendly constants for commonly used Stages.
Example
use bellframe::Stage; assert_eq!(Stage::MINIMUS, Stage::from(4)); assert_eq!(Stage::MINOR, Stage::from(6)); assert_eq!(Stage::TRIPLES, Stage::from(7)); assert_eq!(Stage::FOURTEEN, Stage::from(14)); assert_eq!(Stage::SEPTUPLES, Stage::from(15));
Trait Implementations
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Stageimpl UnwindSafe for StageBlanket Implementations
Mutably borrows from an owned value. Read more