Closed hummingly closed 3 years ago
Splitting the PR would allow to push a new version with numeric value support.
This requires a few things.
enum IcsValue {
Integer(i32),
Float(f32),
Text(Cow<'a, str>),
// Non-exhaustive pattern
}
After playing around with the above strategy it would be better to keep Property as is and instead create a writer. This means the builder types would implement a trait instead and this would be written immediately.
struct IcsWriter {..}
impl IcsWriter {
fn write(property: PropertyWrite) {
write!(...)
}
}
trait PropertyWrite {
fn name() -> impl Display;
fn value() -> impl Display;
fn parameters() -> impl Iterator<K, V>
}
However, version 0.5 should add first the type constructors.
I will keep this branch as reference for the writer-api.
Property builder types use defined value types as defined.
Closes #11 and #10 .