alpha
Login
or
Join now
microcosm.blue
/
microcosm-rs
Star
0
Fork
3
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm
Star
0
Fork
3
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
use the static_str macro everywhere
author
phil
date
1 year ago
(May 20, 2025, 12:31 PM -0400)
commit
f9075589
f9075589ca20ddf5fa5d257bf08ce41bd34bc1f5
parent
c1614c91
c1614c91e2582b8607eda16a9935a29030960485
+14
-74
1 changed file
Expand all
Collapse all
Unified
Split
ufos
src
store_types.rs
+14
-74
ufos/src/store_types.rs
Reviewed
···
18
18
};
19
19
}
20
20
21
21
-
/// key format: ["js_cursor"]
22
22
-
#[derive(Debug, PartialEq)]
23
23
-
pub struct JetstreamCursorKey {}
24
24
-
impl StaticStr for JetstreamCursorKey {
25
25
-
fn static_str() -> &'static str {
26
26
-
"js_cursor"
27
27
-
}
28
28
-
}
21
21
+
// key format: ["js_cursor"]
22
22
+
static_str!("js_cursor", JetstreamCursorKey);
29
23
pub type JetstreamCursorValue = Cursor;
30
24
31
31
-
/// key format: ["rollup_cursor"]
32
32
-
#[derive(Debug, PartialEq)]
33
33
-
pub struct NewRollupCursorKey {}
34
34
-
impl StaticStr for NewRollupCursorKey {
35
35
-
fn static_str() -> &'static str {
36
36
-
"rollup_cursor"
37
37
-
}
38
38
-
}
25
25
+
// key format: ["rollup_cursor"]
26
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
43
-
#[derive(Debug, PartialEq)]
44
44
-
pub struct _TrimCollectionStaticStr {}
45
45
-
impl StaticStr for _TrimCollectionStaticStr {
46
46
-
fn static_str() -> &'static str {
47
47
-
"trim_cursor"
48
48
-
}
49
49
-
}
31
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
59
-
/// key format: ["js_endpoint"]
60
60
-
#[derive(Debug, PartialEq)]
61
61
-
pub struct TakeoffKey {}
62
62
-
impl StaticStr for TakeoffKey {
63
63
-
fn static_str() -> &'static str {
64
64
-
"takeoff"
65
65
-
}
66
66
-
}
41
41
+
// key format: ["js_endpoint"]
42
42
+
static_str!("takeoff", TakeoffKey);
67
43
pub type TakeoffValue = Cursor;
68
44
69
69
-
/// key format: ["js_endpoint"]
70
70
-
#[derive(Debug, PartialEq)]
71
71
-
pub struct JetstreamEndpointKey {}
72
72
-
impl StaticStr for JetstreamEndpointKey {
73
73
-
fn static_str() -> &'static str {
74
74
-
"js_endpoint"
75
75
-
}
76
76
-
}
45
45
+
// key format: ["js_endpoint"]
46
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
202
-
#[derive(Debug, PartialEq)]
203
203
-
pub struct _LiveRecordsStaticStr {}
204
204
-
impl StaticStr for _LiveRecordsStaticStr {
205
205
-
fn static_str() -> &'static str {
206
206
-
"live_counts"
207
207
-
}
208
208
-
}
172
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
288
-
#[derive(Debug, PartialEq)]
289
289
-
pub struct _DeleteAccountStaticStr {}
290
290
-
impl StaticStr for _DeleteAccountStaticStr {
291
291
-
fn static_str() -> &'static str {
292
292
-
"delete_acount"
293
293
-
}
294
294
-
}
252
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
339
-
#[derive(Debug, PartialEq)]
340
340
-
pub struct _HourlyRollupStaticStr {}
341
341
-
impl StaticStr for _HourlyRollupStaticStr {
342
342
-
fn static_str() -> &'static str {
343
343
-
"hourly_counts"
344
344
-
}
345
345
-
}
297
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
364
-
#[derive(Debug, PartialEq)]
365
365
-
pub struct _WeeklyRollupStaticStr {}
366
366
-
impl StaticStr for _WeeklyRollupStaticStr {
367
367
-
fn static_str() -> &'static str {
368
368
-
"weekly_counts"
369
369
-
}
370
370
-
}
316
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
389
-
#[derive(Debug, PartialEq)]
390
390
-
pub struct _AllTimeRollupStaticStr {}
391
391
-
impl StaticStr for _AllTimeRollupStaticStr {
392
392
-
fn static_str() -> &'static str {
393
393
-
"ever_counts"
394
394
-
}
395
395
-
}
335
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 {