Function from_json

Source
pub fn from_json(value: &Json) -> Result<UserData, StoreError>
Expand description

Reads the document back.

A legacy row whose target cannot be parsed is skipped rather than fatal: one corrupted line must not cost the user every note they ever wrote, which is the opposite of the catalog’s rule, where a broken row means the graph does not hold together and refusing is the safe answer. Here there is no graph — only statements, each standing alone. Missing optional tables remain compatible with old stores. A present table of the wrong JSON type is refused before a later write can empty it. New static-playlist and scrobble rows are strictly validated: malformed or oversized rows fail the load, preserving the original file for recovery.