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§
Sourcefn variant(&self) -> impl Into<u16>
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.
Sourcefn set_duration(&mut self, duration: f64)
fn set_duration(&mut self, duration: f64)
Sets the duration of the note.
Sourcefn set_volume(&mut self, volume: u16)
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
Sourcefn set_variant(&mut self, variant: impl Into<u16>)
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§
fn cmp(&self, other: &Self) -> Ordering
Sourcefn matches_variant(&self, variant: impl Into<u16>) -> bool
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.