[feat](trx-frontend-http): add BookmarkStore backed by pickledb

Add pickledb and dirs dependencies. Introduce BookmarkStore wrapping
PickleDb behind Arc<RwLock<>> with list/get/insert/upsert/remove ops.
Keys stored as "bm:{id}" in ~/.config/trx-rs/bookmarks.db; falls back
to ./bookmarks.db when config dir is unavailable.

Wire BookmarkStore into build_server() as actix-web app_data so all
request handlers can share the store.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-01 19:16:50 +01:00
parent 31238098ca
commit 34f6b42330
4 changed files with 114 additions and 0 deletions
Generated
+12
View File
@@ -1586,6 +1586,16 @@ version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
[[package]]
name = "pickledb"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c53a5ade47760e8cc4986bdc5e72daeffaaaee64cbc374f9cfe0a00c1cd87b1f"
dependencies = [
"serde",
"serde_json",
]
[[package]]
name = "pin-project-lite"
version = "0.2.16"
@@ -2503,8 +2513,10 @@ dependencies = [
"actix-web",
"actix-ws",
"bytes",
"dirs",
"futures-util",
"hex",
"pickledb",
"rand 0.8.5",
"serde",
"serde_json",