notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

subscriptions.rs (790B)


      1 use crate::column::ColumnKind;
      2 use std::collections::HashMap;
      3 
      4 #[derive(Debug, Clone)]
      5 pub enum SubKind {
      6     /// Initial subscription. This is the first time we do a remote subscription
      7     /// for a timeline
      8     Initial,
      9 
     10     /// One shot requests, we can just close after we receive EOSE
     11     OneShot,
     12 
     13     Column(ColumnKind),
     14 
     15     /// We are fetching a contact list so that we can use it for our follows
     16     /// Filter.
     17     // TODO: generalize this to any list?
     18     FetchingContactList(u32),
     19 }
     20 
     21 /// Subscriptions that need to be tracked at various stages. Sometimes we
     22 /// need to do A, then B, then C. Tracking requests at various stages by
     23 /// mapping uuid subids to explicit states happens here.
     24 #[derive(Default)]
     25 pub struct Subscriptions {
     26     pub subs: HashMap<String, SubKind>,
     27 }