pub trait ParseableScore: Score {
// Required methods
fn parse(s: &str) -> Result<Self, ScoreParseError>;
fn to_string_repr(&self) -> String;
}Expand description
Marker trait for scores that can be parsed from a string.
Required Methods§
Sourcefn parse(s: &str) -> Result<Self, ScoreParseError>
fn parse(s: &str) -> Result<Self, ScoreParseError>
Parses a score from a string representation.
§Format
- SimpleScore: “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
Returns the string representation of this score.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.