Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm
0

Configure Feed

Select the types of activity you want to include in your feed.

use the static_str macro everywhere

+14 -74
+14 -74
ufos/src/store_types.rs
··· 18 18 }; 19 19 } 20 20 21 - /// key format: ["js_cursor"] 22 - #[derive(Debug, PartialEq)] 23 - pub struct JetstreamCursorKey {} 24 - impl StaticStr for JetstreamCursorKey { 25 - fn static_str() -> &'static str { 26 - "js_cursor" 27 - } 28 - } 21 + // key format: ["js_cursor"] 22 + static_str!("js_cursor", JetstreamCursorKey); 29 23 pub type JetstreamCursorValue = Cursor; 30 24 31 - /// key format: ["rollup_cursor"] 32 - #[derive(Debug, PartialEq)] 33 - pub struct NewRollupCursorKey {} 34 - impl StaticStr for NewRollupCursorKey { 35 - fn static_str() -> &'static str { 36 - "rollup_cursor" 37 - } 38 - } 25 + // key format: ["rollup_cursor"] 26 + static_str!("rollup_cursor", NewRollupCursorKey); 39 27 // pub type NewRollupCursorKey = DbStaticStr<_NewRollupCursorKey>; 40 28 /// value format: [rollup_cursor(Cursor)|collection(Nsid)] 41 29 pub type NewRollupCursorValue = Cursor; 42 30 43 - #[derive(Debug, PartialEq)] 44 - pub struct _TrimCollectionStaticStr {} 45 - impl StaticStr for _TrimCollectionStaticStr { 46 - fn static_str() -> &'static str { 47 - "trim_cursor" 48 - } 49 - } 31 + static_str!("trim_cursor", _TrimCollectionStaticStr); 50 32 type TrimCollectionCursorPrefix = DbStaticStr<_TrimCollectionStaticStr>; 51 33 pub type TrimCollectionCursorKey = DbConcat<TrimCollectionCursorPrefix, Nsid>; 52 34 impl TrimCollectionCursorKey { ··· 56 38 } 57 39 pub type TrimCollectionCursorVal = Cursor; 58 40 59 - /// key format: ["js_endpoint"] 60 - #[derive(Debug, PartialEq)] 61 - pub struct TakeoffKey {} 62 - impl StaticStr for TakeoffKey { 63 - fn static_str() -> &'static str { 64 - "takeoff" 65 - } 66 - } 41 + // key format: ["js_endpoint"] 42 + static_str!("takeoff", TakeoffKey); 67 43 pub type TakeoffValue = Cursor; 68 44 69 - /// key format: ["js_endpoint"] 70 - #[derive(Debug, PartialEq)] 71 - pub struct JetstreamEndpointKey {} 72 - impl StaticStr for JetstreamEndpointKey { 73 - fn static_str() -> &'static str { 74 - "js_endpoint" 75 - } 76 - } 45 + // key format: ["js_endpoint"] 46 + static_str!("js_endpoint", JetstreamEndpointKey); 77 47 #[derive(Debug, PartialEq)] 78 48 pub struct JetstreamEndpointValue(pub String); 79 49 /// String wrapper for jetstream endpoint value ··· 199 169 } 200 170 } 201 171 202 - #[derive(Debug, PartialEq)] 203 - pub struct _LiveRecordsStaticStr {} 204 - impl StaticStr for _LiveRecordsStaticStr { 205 - fn static_str() -> &'static str { 206 - "live_counts" 207 - } 208 - } 172 + static_str!("live_counts", _LiveRecordsStaticStr); 209 173 210 174 type LiveCountsStaticPrefix = DbStaticStr<_LiveRecordsStaticStr>; 211 175 type LiveCountsCursorPrefix = DbConcat<LiveCountsStaticPrefix, Cursor>; ··· 285 249 } 286 250 } 287 251 288 - #[derive(Debug, PartialEq)] 289 - pub struct _DeleteAccountStaticStr {} 290 - impl StaticStr for _DeleteAccountStaticStr { 291 - fn static_str() -> &'static str { 292 - "delete_acount" 293 - } 294 - } 252 + static_str!("delete_acount", _DeleteAccountStaticStr); 295 253 pub type DeleteAccountStaticPrefix = DbStaticStr<_DeleteAccountStaticStr>; 296 254 pub type DeleteAccountQueueKey = DbConcat<DeleteAccountStaticPrefix, Cursor>; 297 255 impl DeleteAccountQueueKey { ··· 336 294 } 337 295 } 338 296 339 - #[derive(Debug, PartialEq)] 340 - pub struct _HourlyRollupStaticStr {} 341 - impl StaticStr for _HourlyRollupStaticStr { 342 - fn static_str() -> &'static str { 343 - "hourly_counts" 344 - } 345 - } 297 + static_str!("hourly_counts", _HourlyRollupStaticStr); 346 298 pub type HourlyRollupStaticPrefix = DbStaticStr<_HourlyRollupStaticStr>; 347 299 pub type HourlyRollupKey = DbConcat<DbConcat<HourlyRollupStaticPrefix, HourTruncatedCursor>, Nsid>; 348 300 impl HourlyRollupKey { ··· 361 313 static_str!("hourly_rank_dids", _HourlyDidsStaticStr); 362 314 pub type HourlyDidsKey = BucketedRankRecordsKey<_HourlyDidsStaticStr, HourTruncatedCursor>; 363 315 364 - #[derive(Debug, PartialEq)] 365 - pub struct _WeeklyRollupStaticStr {} 366 - impl StaticStr for _WeeklyRollupStaticStr { 367 - fn static_str() -> &'static str { 368 - "weekly_counts" 369 - } 370 - } 316 + static_str!("weekly_counts", _WeeklyRollupStaticStr); 371 317 pub type WeeklyRollupStaticPrefix = DbStaticStr<_WeeklyRollupStaticStr>; 372 318 pub type WeeklyRollupKey = DbConcat<DbConcat<WeeklyRollupStaticPrefix, WeekTruncatedCursor>, Nsid>; 373 319 impl WeeklyRollupKey { ··· 386 332 static_str!("weekly_rank_dids", _WeeklyDidsStaticStr); 387 333 pub type WeeklyDidsKey = BucketedRankRecordsKey<_WeeklyDidsStaticStr, WeekTruncatedCursor>; 388 334 389 - #[derive(Debug, PartialEq)] 390 - pub struct _AllTimeRollupStaticStr {} 391 - impl StaticStr for _AllTimeRollupStaticStr { 392 - fn static_str() -> &'static str { 393 - "ever_counts" 394 - } 395 - } 335 + static_str!("ever_counts", _AllTimeRollupStaticStr); 396 336 pub type AllTimeRollupStaticPrefix = DbStaticStr<_AllTimeRollupStaticStr>; 397 337 pub type AllTimeRollupKey = DbConcat<AllTimeRollupStaticPrefix, Nsid>; 398 338 impl AllTimeRollupKey {