pub enum MusicError {
NegativeDuration,
NegativeOnset,
InvalidTempo,
InvalidTimeSignature,
NonMonophonicMelody,
InvalidTimeRange,
InvalidPpq,
InvalidLaneTarget {
lane: String,
target: String,
},
InvalidPianoRollGrid,
PianoRollLaneCellMismatch {
lane: String,
lane_kind: String,
cell_kind: String,
},
}Expand description
Error returned when a musical value violates a model invariant.
Variants§
NegativeDuration
A duration was negative.
NegativeOnset
An onset position was negative.
InvalidTempo
A tempo was zero or otherwise non-positive.
InvalidTimeSignature
A time signature had a zero denominator.
NonMonophonicMelody
A melody contained overlapping voices instead of a single line.
InvalidTimeRange
A play range ended before it started.
InvalidPpq
A play pulses-per-quarter resolution was zero.
InvalidLaneTarget
A lane targeted something incompatible with its event kind.
Fields
InvalidPianoRollGrid
A piano-roll grid had a non-positive ticks-per-quarter or step.
PianoRollLaneCellMismatch
A piano-roll lane held a cell kind it cannot accept.
Trait Implementations§
Source§impl Clone for MusicError
impl Clone for MusicError
Source§fn clone(&self) -> MusicError
fn clone(&self) -> MusicError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MusicError
impl Debug for MusicError
Source§impl Display for MusicError
impl Display for MusicError
impl Eq for MusicError
Source§impl Error for MusicError
impl Error for MusicError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<MusicError> for ConversionError
impl From<MusicError> for ConversionError
Source§fn from(source: MusicError) -> Self
fn from(source: MusicError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for MusicError
impl PartialEq for MusicError
impl StructuralPartialEq for MusicError
Auto Trait Implementations§
impl Freeze for MusicError
impl RefUnwindSafe for MusicError
impl Send for MusicError
impl Sync for MusicError
impl Unpin for MusicError
impl UnsafeUnpin for MusicError
impl UnwindSafe for MusicError
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