pub struct Handler {
pub version: (u32, u32, u32),
pub directives: Vec<(String, String)>,
pub tokens: Vec<Token>,
pub active: Vec<usize>,
}Expand description
music21’s ABCHandler: the tokens of a text and what reading them keeps.
Fields§
§version: (u32, u32, u32)The ABC version read as: (1, 3, 0) and the like.
directives: Vec<(String, String)>The %%key value directives read, in order.
tokens: Vec<Token>The tokens, in the order of the text.
active: Vec<usize>The spanners still open after Handler::process, by where they
stand among those it handed back.
Implementations§
Source§impl Handler
impl Handler
Sourcepub fn accidental_propagation(&self) -> &str
pub fn accidental_propagation(&self) -> &str
music21’s _accidentalPropagation: not, pitch or octave.
Sourcepub fn read_version(&mut self, text: &str)
pub fn read_version(&mut self, text: &str)
music21’s parseHeaderForVersionInformation: the version named by
%abc-2.1 in text.
Sourcepub fn bar_tokens(text: &str) -> Vec<Bar>
pub fn bar_tokens(text: &str) -> Vec<Bar>
music21’s barlineTokenFilter: a bar written as two in one, each
unread.
Sourcepub fn tokenize(&mut self, source: &str) -> Result<()>
pub fn tokenize(&mut self, source: &str) -> Result<()>
music21’s tokenize: the tokens of source added to the handler’s,
what goes wrong placed at its line and column.
Sourcepub fn process(&mut self) -> Result<Vec<Spanning>>
pub fn process(&mut self) -> Result<Vec<Spanning>>
music21’s tokenProcess: each token pre-parsed, told what is in
force where it stands, and then parsed. Hands back the spanners the
tokens started; those left open are in active.
Sourcepub fn defines_reference_numbers(&self) -> bool
pub fn defines_reference_numbers(&self) -> bool
music21’s definesReferenceNumbers: more than one X:.
Sourcepub fn reference_number(&self) -> Option<&str>
pub fn reference_number(&self) -> Option<&str>
music21’s getReferenceNumber: the first X: line’s data.
Sourcepub fn split_by_reference_number(
&self,
) -> Result<Vec<(Option<IntegerType>, Vec<usize>)>>
pub fn split_by_reference_number( &self, ) -> Result<Vec<(Option<IntegerType>, Vec<usize>)>>
music21’s splitByReferenceNumber: each tune’s tokens by index, the
tokens before the first X: in front of each, keyed by number in
the order the numbers first stand. A number met again takes the
later tune. With no X: at all, the one tune has no number.
Sourcepub fn defines_measures(&self) -> bool
pub fn defines_measures(&self) -> bool
music21’s definesMeasures: two plain barlines or more.
Sourcepub fn split_by_voice(&self) -> Vec<Range<usize>>
pub fn split_by_voice(&self) -> Vec<Range<usize>>
music21’s splitByVoice: the header, and the tokens of each voice
whose V: line starts with a digit; all the tokens where there are
fewer than two voices.
Sourcepub fn bar_indices(&self) -> Vec<usize>
pub fn bar_indices(&self) -> Vec<usize>
music21’s tokensToBarIndices: where each bar stands, and each line
of metadata a note follows.
Sourcepub fn split_by_measure(&self) -> Vec<MeasureSplit>
pub fn split_by_measure(&self) -> Vec<MeasureSplit>
music21’s splitByMeasure: the tokens of each measure and the bars
either side, a repeat’s end kept for the measure before it and a
repeat’s start for the one after.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Handler
impl Freeze for Handler
impl Move for Handler
impl RefUnwindSafe for Handler
impl Send for Handler
impl Sync for Handler
impl Unpin for Handler
impl UnsafeUnpin for Handler
impl UnwindSafe for Handler
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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