mirror of
https://github.com/nullishamy/ferri.git
synced 2025-04-29 20:29:23 +00:00
Plan and implement type/trait system for all of our serialisation types #7
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A collection of traits and types should be used to generate, convert, and serialise our data. This will need to do these operations for:
You should be able to convert from any of these type to any of the other types, though for some conversions it may be required to go through the DB first to pick up information that isn't present in the source.
https://www.reddit.com/r/rust/comments/1b98wyj/setting_a_field_in_serde_to_default_to_another/ useful for doing the serde work
we actually only need to go from ap <-> db and db <-> api, so the DB will act as the source of truth.
mastoapi/ap are only controlling the machine, so the db can store enough data to satisfy all needs
(inherently, this must be the case, otherwise we would be making data up)
the std From traits will be used to technically necessitate the DB knowing all (e.g, no dynamic URL creation during conversion from config)
it would still be possible to jump from ap <-> mastoapi, you would just have to query for it through the DB. the conversions are cheap and going through the DB ensures consistency.