Enum tune::scala::KbmBuildError [−][src]
Error reported when building a Kbm
fails.
Variants
No formal octave parameter has been set.
The formal octave parameter is mandatory if at least one key is pushed.
Examples
// No key pushed. The mapping is linear and the formal octave parameter is optional. let optional = Kbm::builder(Note::from_midi_number(0)); assert!(optional.build().is_ok()); // At least one key pushed. The formal octave parameter is mandatory. let mandatory = Kbm::builder(Note::from_midi_number(0)).push_mapped_key(0); assert_eq!(mandatory.build().unwrap_err(), KbmBuildError::FormalOctaveMissing);
There are too many items in this mapping.
// The number of items is below the threshold. let mut below = Kbm::builder(Note::from_midi_number(62)).formal_octave(0); for _ in 0..65535 { below = below.push_mapped_key(0); } assert!(below.build().is_ok()); // The number of items is above the threshold. let mut above = Kbm::builder(Note::from_midi_number(62)).formal_octave(0); for _ in 0..65536 { above = above.push_mapped_key(0); } assert_eq!(above.build().unwrap_err(), KbmBuildError::MappingTooLarge);
Trait Implementations
impl Clone for KbmBuildError
[src]
fn clone(&self) -> KbmBuildError
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for KbmBuildError
[src]
impl Eq for KbmBuildError
[src]
impl From<KbmBuildError> for KbmImportError
[src]
fn from(v: KbmBuildError) -> Self
[src]
impl PartialEq<KbmBuildError> for KbmBuildError
[src]
fn eq(&self, other: &KbmBuildError) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for KbmBuildError
[src]
impl StructuralPartialEq for KbmBuildError
[src]
Auto Trait Implementations
impl RefUnwindSafe for KbmBuildError
impl Send for KbmBuildError
impl Sync for KbmBuildError
impl Unpin for KbmBuildError
impl UnwindSafe for KbmBuildError
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,