pub trait ParseableScore: Score {
// Required methods
fn parse(s: &str) -> Result<Self, ScoreParseError>;
fn to_string_repr(&self) -> String;
}Expand description
Scores with a text form that can be parsed and rendered.
Required Methods§
Sourcefn parse(s: &str) -> Result<Self, ScoreParseError>
fn parse(s: &str) -> Result<Self, ScoreParseError>
Parses a score from a string representation.
§Format
- SoftScore: “42” or “42init”
- HardSoftScore: “0hard/-100soft” or “-1hard/0soft”
- HardMediumSoftScore: “0hard/0medium/-100soft”
Sourcefn to_string_repr(&self) -> String
fn to_string_repr(&self) -> String
Renders the score in the format parse accepts.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".