pub struct NwcReader<'a> {
pub at: usize,
pub version: u32,
pub alterations: Vec<(i32, String)>,
/* private fields */
}Expand description
music21’s NWCConverter as a reader: the file, where it has got to in
it, its version, and the alteration last written on each staff
position, by the position modulo seven, until a barline.
Fields§
§at: usizeWhere the next read starts: music21’s parsePosition.
version: u32The file’s version, as music21 numbers it: 175 for 1.75.
alterations: Vec<(i32, String)>music21’s currentAlterations.
Implementations§
Source§impl<'a> NwcReader<'a>
impl<'a> NwcReader<'a>
Sourcepub fn new(data: &'a [u8], version: u32) -> Self
pub fn new(data: &'a [u8], version: u32) -> Self
A reader over a file’s (inflated) bytes, at its start, taken to be
of version until its header says.
Sourcepub fn header(&mut self) -> Result<NwcHeader>
pub fn header(&mut self) -> Result<NwcHeader>
music21’s parseHeader, with fileVersion read where music21
reads it. The version read is kept.
§Errors
A file that ends inside its header.
Sourcepub fn staff(&mut self) -> Result<NwcStaff>
pub fn staff(&mut self) -> Result<NwcStaff>
music21’s NWCStaff.parse: a staff’s header, its verses and its
objects.
§Errors
A file that ends inside the staff, or an object music21 cannot read.
Sourcepub fn staff_objects(&mut self) -> Result<(i32, Vec<NwcObject>)>
pub fn staff_objects(&mut self) -> Result<(i32, Vec<NwcObject>)>
NWCStaff.parseObjects: how many objects the staff says it has,
and the objects.
§Errors
As Self::staff.
Sourcepub fn staff_header(&mut self) -> Result<NwcStaff>
pub fn staff_header(&mut self) -> Result<NwcStaff>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for NwcReader<'a>
impl<'a> Freeze for NwcReader<'a>
impl<'a> Move for NwcReader<'a>
impl<'a> RefUnwindSafe for NwcReader<'a>
impl<'a> Send for NwcReader<'a>
impl<'a> Sync for NwcReader<'a>
impl<'a> Unpin for NwcReader<'a>
impl<'a> UnsafeUnpin for NwcReader<'a>
impl<'a> UnwindSafe for NwcReader<'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
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