1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// SPDX-License-Identifier: Apache-2.0
//! What to do when opening a store that cannot be read.
//!
//! An embedded database is frequently the only copy of its data. Whether a
//! damaged store can be thrown away and rebuilt depends on something only the
//! embedder knows — whether an Origin exists to re-sync from, whether the data
//! is reproducible, whether starting empty is worse than not starting. So the
//! library reports the fault and stops; discarding is a decision the caller
//! makes, in advance, by name.
//!
//! Note that "does this store sync?" is not something the library can infer at
//! open time. `LiteConfig::sync_enabled` governs whether writes record
//! themselves for the push to Origin, not whether an Origin has ever been
//! reachable, and `start_sync` is called after open in any case. Treating either as consent to discard would
//! reintroduce exactly the silent decision this type exists to prevent.
use ;
/// How [`open`](crate::storage::pagedb_storage::PagedbStorage) reacts to a
/// corruption-class fault in the store it was asked to open.