syncweb-core 0.1.1-alpha.2

delay-tolerant web surfing
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use serde::{Deserialize, Serialize};

/// Controls whether a synchronization session exits after one reconciliation
/// or remains subscribed to changes.
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, Default)]
#[non_exhaustive]
pub enum SessionMode {
    #[default]
    ReconcileOnce,
    Continuous,
}

impl SessionMode {
    #[must_use]
    pub const fn is_continuous(self) -> bool {
        matches!(self, Self::Continuous)
    }
}