pub struct RepeatExpression { /* private fields */ }Expand description
A word or sign telling a player where to go next: music21’s
RepeatExpression.
use music21_rs::repeat::{RepeatExpression, RepeatExpressionKind};
let fine = RepeatExpression::new(RepeatExpressionKind::Fine);
assert_eq!(fine.text(), "fine");
assert!(!fine.use_symbol());
let coda = RepeatExpression::with_text(RepeatExpressionKind::Coda, "to Coda");
assert_eq!(coda.text(), "to Coda");
assert!(!coda.use_symbol());Implementations§
Source§impl RepeatExpression
impl RepeatExpression
Sourcepub fn new(kind: RepeatExpressionKind) -> Self
pub fn new(kind: RepeatExpressionKind) -> Self
A mark of a kind, written as music21 writes it when nothing says otherwise: a coda and a segno as their signs, everything else in words.
Sourcepub fn with_text(kind: RepeatExpressionKind, text: &str) -> Self
pub fn with_text(kind: RepeatExpressionKind, text: &str) -> Self
A mark of a kind written in these words, where they are one of its
ways of being written, and as it is written by default otherwise:
music21’s text argument. A coda given words is written in them
rather than as its sign. A segno and fine are always written their
own way.
Sourcepub fn kind(&self) -> RepeatExpressionKind
pub fn kind(&self) -> RepeatExpressionKind
Which kind of mark this is.
Sourcepub fn set_text(&mut self, text: impl Into<String>)
pub fn set_text(&mut self, text: impl Into<String>)
Writes the mark in other words, whatever they are: music21’s
setText.
Sourcepub fn is_valid_text(&self, text: &str) -> bool
pub fn is_valid_text(&self, text: &str) -> bool
Whether these words are one of the ways this kind of mark is
written, ignoring case, spaces and full stops: music21’s
isValidText.
Sourcepub fn use_symbol(&self) -> bool
pub fn use_symbol(&self) -> bool
Whether the mark is drawn as its sign rather than in words.
Sourcepub fn set_use_symbol(&mut self, use_symbol: bool)
pub fn set_use_symbol(&mut self, use_symbol: bool)
Says whether the mark is drawn as its sign. Only a coda and a segno have one to draw.
Sourcepub fn placement(&self) -> Option<Placement>
pub fn placement(&self) -> Option<Placement>
Which side of the staff the words are written on, where a score says.
Sourcepub fn set_placement(&mut self, placement: Option<Placement>)
pub fn set_placement(&mut self, placement: Option<Placement>)
Says which side of the staff the words are written on.
Trait Implementations§
Source§impl Clone for RepeatExpression
impl Clone for RepeatExpression
Source§impl Debug for RepeatExpression
impl Debug for RepeatExpression
Source§impl<'de> Deserialize<'de> for RepeatExpression
Available on crate feature serde only.
impl<'de> Deserialize<'de> for RepeatExpression
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>,
impl Eq for RepeatExpression
Source§impl From<RepeatExpression> for StreamElement
impl From<RepeatExpression> for StreamElement
Source§fn from(value: RepeatExpression) -> Self
fn from(value: RepeatExpression) -> Self
Source§impl Hash for RepeatExpression
impl Hash for RepeatExpression
Source§impl PartialEq for RepeatExpression
impl PartialEq for RepeatExpression
Source§impl Serialize for RepeatExpression
Available on crate feature serde only.
impl Serialize for RepeatExpression
serde only.impl StructuralPartialEq for RepeatExpression
Auto Trait Implementations§
impl Freeze for RepeatExpression
impl RefUnwindSafe for RepeatExpression
impl Send for RepeatExpression
impl Sync for RepeatExpression
impl Unpin for RepeatExpression
impl UnsafeUnpin for RepeatExpression
impl UnwindSafe for RepeatExpression
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