Skip to main content

ExportOptions

Struct ExportOptions 

Source
pub struct ExportOptions {
    pub encoding_date: Option<String>,
    pub software: String,
    pub default_title: Option<String>,
    pub default_author: Option<String>,
    pub make_notation: bool,
}
Available on crate feature musicxml only.
Expand description

What a document says about how it was made, where the score does not say.

The defaults are music21’s own, so that a score written here reads as the one music21 writes; a caller making a document of its own will want its own title and author, or none.

Fields§

§encoding_date: Option<String>

The <encoding-date>, as YYYY-MM-DD. music21 writes the day it ran; the crate reads no clock, so the date is written only when given.

§software: String

The <software> line written when the score carries no metadata. A score with metadata names its software there instead.

§default_title: Option<String>

The movement title of a score with no title of its own: music21’s defaults.title, Music21 Fragment.

§default_author: Option<String>

The composer named when the score names no contributor: music21’s defaults.author, Music21.

§make_notation: bool

Whether to work out the notation the score leaves unsaid before writing it, as music21’s exporter does with makeNotation=True: gaps filled with unprinted rests, a part with no measures cut into them, notes running past a barline cut and tied, accidentals decided, notes beamed and tuplets bracketed where the part has none yet, and lengths no single note value writes cut into tied values. A measure or a voice handed in alone is written as a part of one measure, given the meter and clef its notes fit where it states none. The score handed in is not changed.

Off, the score is written as it stands, which is music21’s makeNotation=False: a caller that has made its notation already gets exactly what it made.

Trait Implementations§

Source§

impl Clone for ExportOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExportOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ExportOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for ExportOptions

Source§

impl PartialEq for ExportOptions

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ExportOptions

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.