Plan and implement type/trait system for all of our serialisation types #7

Open
opened 2025-04-22 20:30:14 +00:00 by amy · 3 comments
Owner

A collection of traits and types should be used to generate, convert, and serialise our data. This will need to do these operations for:

  • Database
  • AP
  • MastoAPI

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.

A collection of traits and types should be used to generate, convert, and serialise our data. This will need to do these operations for: - Database - AP - MastoAPI 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.
amy added the
enhancement
label 2025-04-22 20:30:14 +00:00
Author
Owner
https://www.reddit.com/r/rust/comments/1b98wyj/setting_a_field_in_serde_to_default_to_another/ useful for doing the serde work
Author
Owner

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)

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)
Author
Owner

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.

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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: amy/ferri#7
No description provided.