mirror of
https://github.com/aljazceru/notedeck.git
synced 2026-01-15 06:14:20 +01:00
28 lines
790 B
Rust
28 lines
790 B
Rust
use crate::column::ColumnKind;
|
|
use std::collections::HashMap;
|
|
|
|
#[derive(Debug, Clone)]
|
|
pub enum SubKind {
|
|
/// Initial subscription. This is the first time we do a remote subscription
|
|
/// for a timeline
|
|
Initial,
|
|
|
|
/// One shot requests, we can just close after we receive EOSE
|
|
OneShot,
|
|
|
|
Column(ColumnKind),
|
|
|
|
/// We are fetching a contact list so that we can use it for our follows
|
|
/// Filter.
|
|
// TODO: generalize this to any list?
|
|
FetchingContactList(u32),
|
|
}
|
|
|
|
/// Subscriptions that need to be tracked at various stages. Sometimes we
|
|
/// need to do A, then B, then C. Tracking requests at various stages by
|
|
/// mapping uuid subids to explicit states happens here.
|
|
#[derive(Default)]
|
|
pub struct Subscriptions {
|
|
pub subs: HashMap<String, SubKind>,
|
|
}
|