pub struct GabcFile<'a> {
pub attributes: Vec<(&'a str, &'a str)>,
pub syllables: Vec<Syllable<'a>>,
}
Expand description
Struct representing an entire gabc file.
Fields§
§attributes: Vec<(&'a str, &'a str)>
This file’s attributes, e.g. “name: Populus Sion”, as key/value tuples
syllables: Vec<Syllable<'a>>
This file’s Syllable
s
Implementations§
Source§impl<'a> GabcFile<'a>
impl<'a> GabcFile<'a>
Sourcepub fn new(gabc_input: &str) -> GabcFile<'_>
pub fn new(gabc_input: &str) -> GabcFile<'_>
Create a new GabcFile
from well-formed gabc input.
§Examples
let s = "name:Test;
%%
(c1) Hel(e.)lo(hi~) (::)";
let f = GabcFile::new(s);
assert_eq!(f.attributes[0], ("name", "Test"));
assert_eq!(f.syllables.len(), 4); //clefs currently produce an empty syllable
Sourcepub fn as_lilypond(&self) -> String
pub fn as_lilypond(&self) -> String
Translate this GabcFile
into a well-formed Lilypond file, by translating its text and music
and inserting them into a template derived from
http://lilypond.org/doc/v2.18/Documentation/snippets/templates#templates-ancient-notation-template-_002d-modern-transcription-of-gregorian-music
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for GabcFile<'a>
impl<'a> RefUnwindSafe for GabcFile<'a>
impl<'a> Send for GabcFile<'a>
impl<'a> Sync for GabcFile<'a>
impl<'a> Unpin for GabcFile<'a>
impl<'a> UnwindSafe for GabcFile<'a>
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> 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