syncweb_core/sync/session.rs
1use serde::{Deserialize, Serialize};
2
3/// Controls whether a synchronization session exits after one reconciliation
4/// or remains subscribed to changes.
5#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, Default)]
6#[non_exhaustive]
7pub enum SessionMode {
8 #[default]
9 ReconcileOnce,
10 Continuous,
11}
12
13impl SessionMode {
14 #[must_use]
15 pub const fn is_continuous(self) -> bool {
16 matches!(self, Self::Continuous)
17 }
18}