pub struct Rest { /* private fields */ }Expand description
A silent musical event with a duration.
A rest may still carry words: a syllable written under a rest is how a
score says a line is spoken there, or how a verse number sits at the start
of a phrase that opens on a rest. music21 writes the lyric methods once on
GeneralNote, and a rest has them as a note does.
Two rests are equal when they last as long; what is written under them does not count, as it does not in music21.
Implementations§
Source§impl Rest
impl Rest
Sourcepub fn full_measure(&self) -> Option<bool>
pub fn full_measure(&self) -> Option<bool>
Whether the rest stands for the whole of its measure, however long
it is written: music21’s fullMeasure, nothing for its auto. The
MusicXML reader says so where music21’s does.
Sourcepub fn set_full_measure(&mut self, full_measure: Option<bool>)
pub fn set_full_measure(&mut self, full_measure: Option<bool>)
Says whether the rest stands for the whole of its measure.
Sourcepub fn grace_note(&self, appoggiatura: bool) -> Self
pub fn grace_note(&self, appoggiatura: bool) -> Self
This rest written as a grace note’s value and lasting no time:
music21’s getGrace, which a rest has as a note does.
Sourcepub fn tie(&self) -> Option<&Tie>
pub fn tie(&self) -> Option<&Tie>
The tie written on the rest, which music21 lets a rest carry and a score now and then writes.
Sourcepub fn size(&self) -> Option<NoteSize>
pub fn size(&self) -> Option<NoteSize>
How large the rest is drawn, where a score says, as a cue part’s rests are drawn small.
Sourcepub fn step_shift(&self) -> IntegerType
pub fn step_shift(&self) -> IntegerType
How many staff steps above the middle line the rest is drawn, below
where negative: music21’s stepShift, which a score uses to keep one
voice’s rests out of another’s way.
Sourcepub fn set_step_shift(&mut self, shift: IntegerType)
pub fn set_step_shift(&mut self, shift: IntegerType)
Says how many staff steps from the middle line it is drawn.
Sourcepub fn expressions(&self) -> &[Expression]
pub fn expressions(&self) -> &[Expression]
The fermatas and other marks written over the rest: music21’s
expressions, which a rest has as a note does.
Sourcepub fn expressions_mut(&mut self) -> &mut Vec<Expression>
pub fn expressions_mut(&mut self) -> &mut Vec<Expression>
The same, to be changed.
Sourcepub fn articulations(&self) -> &[Articulation]
pub fn articulations(&self) -> &[Articulation]
The articulations written on the rest: music21’s articulations.
Sourcepub fn articulations_mut(&mut self) -> &mut Vec<Articulation>
pub fn articulations_mut(&mut self) -> &mut Vec<Articulation>
The same, to be changed.
Whether it is left off the printed page, keeping its place and its
time: music21’s style.hideObjectOnPrint, which a score uses for a
rest that only fills out a voice.
Says whether it is left off the printed page.
Sourcepub fn from_quarter_length(quarter_length: FloatType) -> Result<Self>
pub fn from_quarter_length(quarter_length: FloatType) -> Result<Self>
Creates a rest from a quarter-length value.
Sourcepub fn set_duration(&mut self, duration: Duration)
pub fn set_duration(&mut self, duration: Duration)
Updates the rest duration.
Sourcepub fn quarter_length(&self) -> FloatType
pub fn quarter_length(&self) -> FloatType
Returns the duration in quarter lengths.
Sourcepub fn full_name(&self) -> String
pub fn full_name(&self) -> String
The most complete name of the rest, its length included: music21’s
fullName, Dotted Quarter Rest.
Sourcepub fn lyrics_mut(&mut self) -> &mut Vec<Lyric>
pub fn lyrics_mut(&mut self) -> &mut Vec<Lyric>
The syllables written under the rest, for editing in place.
Sourcepub fn set_lyric(&mut self, lyric: Option<&str>)
pub fn set_lyric(&mut self, lyric: Option<&str>)
Replaces every verse with one per line of the text, or clears them
with None: music21’s lyric setter.
Sourcepub fn add_lyric(
&mut self,
text: &str,
number: Option<IntegerType>,
apply_raw: bool,
)
pub fn add_lyric( &mut self, text: &str, number: Option<IntegerType>, apply_raw: bool, )
Adds a syllable as a verse: music21’s addLyric, which a rest has
as a note has it. See crate::Note::add_lyric.
Sourcepub fn insert_lyric(&mut self, text: &str, index: usize, apply_raw: bool)
pub fn insert_lyric(&mut self, text: &str, index: usize, apply_raw: bool)
Puts a syllable in front of the verse at index: music21’s
insertLyric.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Rest
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Rest
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<Rest> for StreamElement
impl From<Rest> for StreamElement
Auto Trait Implementations§
impl Freeze for Rest
impl RefUnwindSafe for Rest
impl Send for Rest
impl Sync for Rest
impl Unpin for Rest
impl UnsafeUnpin for Rest
impl UnwindSafe for Rest
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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