pub enum SyncMode {
Full,
Metadata,
Off,
}Expand description
Per-document sync policy. The wire/config token is the lowercase variant
name (full | metadata | off).
Variants§
Full
Metadata record + document bytes (blob) + reading state. The default, and the historical all-in behavior.
Metadata
Metadata record + reading state (progress, bookmarks, highlights, notes), but never the document bytes — the file stays on the device.
Off
Nothing about this document leaves (or reaches) the device.
Implementations§
Source§impl SyncMode
impl SyncMode
Sourcepub fn most_restrictive(self, other: SyncMode) -> SyncMode
pub fn most_restrictive(self, other: SyncMode) -> SyncMode
The more restrictive of two modes — the effective mode when a server
ceiling and a client clamp both apply. Combining is a min on rank, so a
client can lower its mode but never raise it above the server’s.
Sourcepub fn syncs_blob(self) -> bool
pub fn syncs_blob(self) -> bool
Whether the document’s bytes (blob) may sync in this mode.
Sourcepub fn syncs_state(self) -> bool
pub fn syncs_state(self) -> bool
Whether reading state (progress + annotations) and the metadata record may sync in this mode.
Sourcepub fn syncs_anything(self) -> bool
pub fn syncs_anything(self) -> bool
Whether anything at all syncs. False only for SyncMode::Off.
Sourcepub fn from_token_or_default(s: &str) -> SyncMode
pub fn from_token_or_default(s: &str) -> SyncMode
Parse a stored/wire token, falling back to SyncMode::Full for anything
unrecognized (an older row, a hand-edited value) so a bad token never
silently disables sync.