Trait Note

Source
pub trait Note:
    Debug
    + Ord
    + Clone {
    // Required methods
    fn start(&self) -> f64;
    fn duration(&self) -> f64;
    fn volume(&self) -> u16;
    fn variant(&self) -> impl Into<u16>;
    fn set_start(&mut self, start: f64);
    fn set_duration(&mut self, duration: f64);
    fn set_volume(&mut self, volume: u16);
    fn set_variant(&mut self, variant: impl Into<u16>);

    // Provided methods
    fn cmp(&self, other: &Self) -> Ordering { ... }
    fn matches_variant(&self, variant: impl Into<u16>) -> bool { ... }
}
Expand description

The Note trait represents a rhythm note. (combo notes can be seen as a single note with volume > 1)

Required Methods§

Source

fn start(&self) -> f64

Returns the start time of the note.

Source

fn duration(&self) -> f64

Returns the duration of the note.

Source

fn volume(&self) -> u16

Returns the volume (max hit count) of the note.

Source

fn variant(&self) -> impl Into<u16>

Returns the user-defined hit type of the note. For multi-track rhythm games, this can be used to the track number.

Source

fn set_start(&mut self, start: f64)

Sets the start time of the note.

Source

fn set_duration(&mut self, duration: f64)

Sets the duration of the note.

Source

fn set_volume(&mut self, volume: u16)

Sets the volume (max hit count) of the note. (combo notes can be seen as a single note with volume > 1

Source

fn set_variant(&mut self, variant: impl Into<u16>)

Sets the user-defined hit type of the note. For multi-track rhythm games, this can be used to the track number.

Provided Methods§

Source

fn cmp(&self, other: &Self) -> Ordering

Source

fn matches_variant(&self, variant: impl Into<u16>) -> bool

Checks if the note matches a specific variant.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§