Open SpriteOvO opened 11 months ago
There's still a lot of work to be done on this, and I'd like to delay it to v0.5.0
. This way we can release v0.4.0
earlier to provide many of the small fixes, since backporting existing fixes has been a bit difficult.
This is an early implementation of #25 in progress. It is currently very incomplete, just for previewing its API and approach.
Note to self: Remember to change the base branch to
main
ormain-dev
before merging.We mainly introduced a new trait:
then we implement it for built-in sinks and formatters like:
Of course, users can implement this trait for their own sinks and formatters.
With the power of
erased-serde
, we can cast thetype Params
to adyn erased_serde::Deserializer
to be used later. (Checkconfig/registry.rs
)When we deserializing a sink or formatter, we will first read the
name
field, then look it up from the registry, if found, deserializing the rest of the fields using the erased storedDeserializer
. (Checkconfig/parse.rs
)This whole deserialization process will be very hidden to users!
trait Configurable
and.register_xxx()
is the only thing they need to care about if they have their own sink / formatter.