pub struct KeyParser { /* private fields */ }Implementations§
Source§impl KeyParser
impl KeyParser
Sourcepub fn try_from_string<'a>(s: &str) -> Result<Self, &'a str>
pub fn try_from_string<'a>(s: &str) -> Result<Self, &'a str>
Try parsing a Key from string.
§Example:
use libkeynotation::{Key, KeyParser, NotationType};
let parsed_key = KeyParser::try_from_string("G#m");
assert_eq!(parsed_key.is_ok(), true);
let parsed_key = parsed_key.unwrap();
assert_eq!(parsed_key.key(), Key::GSharpMinor);
assert_eq!(parsed_key.notation_type(), NotationType::Traditional);Sourcepub fn notation_type(&self) -> NotationType
pub fn notation_type(&self) -> NotationType
You want to know what notation representation the parser detected?
pub fn key(&self) -> Key
Auto Trait Implementations§
impl Freeze for KeyParser
impl RefUnwindSafe for KeyParser
impl Send for KeyParser
impl Sync for KeyParser
impl Unpin for KeyParser
impl UnwindSafe for KeyParser
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