pub struct Bar {
pub src: String,
pub bar_type: String,
pub bar_style: String,
pub repeat_form: String,
}Expand description
A bar token: music21’s ABCBar. Its fields are empty until
Bar::parse.
Fields§
§src: StringThe text it was read from.
bar_type: Stringrepeat or barline; empty where the text is no bar at all.
bar_style: Stringregular, light-heavy and the like.
repeat_form: Stringend, start, first or second.
Implementations§
Source§impl Bar
impl Bar
Sourcepub fn parse(&mut self)
pub fn parse(&mut self)
music21’s ABCBar.parse: the type, style and repeat form its text
names.
use music21::abc::step::Bar;
let bar = Bar::parsed("|:");
assert_eq!((bar.bar_type.as_str(), bar.bar_style.as_str()), ("repeat", "heavy-light"));
assert_eq!(bar.repeat_form, "start");Sourcepub fn is_regular(&self) -> bool
pub fn is_regular(&self) -> bool
music21’s isRegular: a single light barline.
Sourcepub fn repeat_bracket(&self) -> Option<u32>
pub fn repeat_bracket(&self) -> Option<u32>
music21’s isRepeatBracket: which ending the bar opens, where it
opens one.
Trait Implementations§
impl StructuralPartialEq for Bar
Auto Trait Implementations§
impl Forget for Bar
impl Freeze for Bar
impl Move for Bar
impl RefUnwindSafe for Bar
impl Send for Bar
impl Sync for Bar
impl Unpin for Bar
impl UnsafeUnpin for Bar
impl UnwindSafe for Bar
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<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