#[repr(C)]pub enum TriadError {
InvalidPitch(String),
InvalidInterval(String),
InvalidTriad(String),
Music(MusicErr),
Unknown(String),
}Variants§
Implementations§
Source§impl TriadError
impl TriadError
Sourcepub const fn is_invalid_pitch(&self) -> bool
pub const fn is_invalid_pitch(&self) -> bool
Returns true if the enum is TriadError::InvalidPitch otherwise false
Sourcepub const fn is_invalid_interval(&self) -> bool
pub const fn is_invalid_interval(&self) -> bool
Returns true if the enum is TriadError::InvalidInterval otherwise false
Sourcepub const fn is_invalid_triad(&self) -> bool
pub const fn is_invalid_triad(&self) -> bool
Returns true if the enum is TriadError::InvalidTriad otherwise false
Sourcepub const fn is_music(&self) -> bool
pub const fn is_music(&self) -> bool
Returns true if the enum is TriadError::Music otherwise false
Sourcepub const fn is_unknown(&self) -> bool
pub const fn is_unknown(&self) -> bool
Returns true if the enum is TriadError::Unknown otherwise false
Source§impl TriadError
impl TriadError
pub fn invalid_pitch(msg: impl ToString) -> Self
pub fn invalid_interval(msg: impl ToString) -> Self
pub fn invalid_triad(msg: impl ToString) -> Self
pub fn unknown(msg: impl Into<String>) -> Self
Trait Implementations§
Source§impl AsRef<str> for TriadError
impl AsRef<str> for TriadError
Source§impl Clone for TriadError
impl Clone for TriadError
Source§fn clone(&self) -> TriadError
fn clone(&self) -> TriadError
Returns a duplicate of the value. Read more
1.0.0 · 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 TriadError
impl Debug for TriadError
Source§impl<'de> Deserialize<'de> for TriadError
impl<'de> Deserialize<'de> for TriadError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for TriadError
impl Display for TriadError
Source§impl Error for TriadError
impl Error for TriadError
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<MusicErr> for TriadError
impl From<MusicErr> for TriadError
Source§impl From<Pitch> for TriadError
impl From<Pitch> for TriadError
Source§impl Hash for TriadError
impl Hash for TriadError
Source§impl Ord for TriadError
impl Ord for TriadError
Source§fn cmp(&self, other: &TriadError) -> Ordering
fn cmp(&self, other: &TriadError) -> Ordering
1.21.0 · 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 PartialEq for TriadError
impl PartialEq for TriadError
Source§impl PartialOrd for TriadError
impl PartialOrd for TriadError
Source§impl Serialize for TriadError
impl Serialize for TriadError
Source§impl VariantNames for TriadError
impl VariantNames for TriadError
impl Eq for TriadError
impl StructuralPartialEq for TriadError
Auto Trait Implementations§
impl Freeze for TriadError
impl RefUnwindSafe for TriadError
impl Send for TriadError
impl Sync for TriadError
impl Unpin for TriadError
impl UnwindSafe for TriadError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more