pub struct Tier(/* private fields */);Expand description
A tier index, relative to the beat.
Implementations§
Source§impl Tier
impl Tier
Sourcepub const fn new(k: i8) -> Result<Tier>
pub const fn new(k: i8) -> Result<Tier>
Construct from a tier index, rejecting indices outside the grid.
Sourcepub const fn from_exponent(exponent: u32) -> Result<Tier>
pub const fn from_exponent(exponent: u32) -> Result<Tier>
Construct from a power-of-five exponent, which must lie on the grid.
Sourcepub const fn exponent(self) -> u32
pub const fn exponent(self) -> u32
The power-of-five exponent. This is the tier’s canonical identity (Rule N).
Sourcepub const fn is_tick(self) -> bool
pub const fn is_tick(self) -> bool
Whether this is the tick tier, where truncation is the identity.
Sourcepub const fn coarser(self) -> Option<Tier>
pub const fn coarser(self) -> Option<Tier>
The next coarser tier, or None at the top of the grid.
Sourcepub fn all_descending() -> impl Iterator<Item = Tier>
pub fn all_descending() -> impl Iterator<Item = Tier>
Every tier, coarsest first.
Sourcepub fn all_ascending() -> impl Iterator<Item = Tier>
pub fn all_ascending() -> impl Iterator<Item = Tier>
Every tier, finest first.
Trait Implementations§
impl Copy for Tier
impl Eq for Tier
Source§impl Ord for Tier
impl Ord for Tier
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 Tier
impl PartialOrd for Tier
impl StructuralPartialEq for Tier
Auto Trait Implementations§
impl Freeze for Tier
impl RefUnwindSafe for Tier
impl Send for Tier
impl Sync for Tier
impl Unpin for Tier
impl UnsafeUnpin for Tier
impl UnwindSafe for Tier
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