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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// SPDX-License-Identifier: MIT OR Apache-2.0
// Config verb and tuning constants (v0.1.37, T6a).
// Included from constants.rs.
// --- Config files (src/config.rs, src/storage.rs, src/commands/config_cmd.rs) ---
/// `ProjectDirs` application name that roots every XDG path of the product.
pub const STORAGE_APP_NAME: &str = "atomwrite";
/// File name of the global config inside the config directory.
pub const GLOBAL_CONFIG_FILE: &str = "config.toml";
/// File name of the workspace config, at the workspace root.
pub const WORKSPACE_CONFIG_FILE: &str = ".atomwrite.toml";
/// File name of the persisted UI locale preference inside the config directory.
pub const LOCALE_PREFERENCE_FILE: &str = "locale";
/// Unix mode of every config file the `config` verb and `locale --set` write.
pub const CONFIG_FILE_PERMISSIONS: u32 = 0o600;
// --- Reason markers of the tuning validation (src/config_tuning.inc.rs) ---
/// Words inside the `reason` of a value outside its range.
///
/// The emitter builds the reason from this constant and `error/suggest.inc.rs`
/// finds it there to pick the localized hint, so the two cannot drift apart.
pub const CONFIG_OUT_OF_RANGE_REASON_MARKER: &str = "is out of range; must be";
/// Words inside the `reason` of a key above the key it must not exceed.
pub const CONFIG_RELATION_REASON_MARKER: &str = "must not exceed";
// --- Accepted range of every tuning key (src/config_tuning.inc.rs) ---
// `config set` and the startup load share these bounds, so a value that one
// accepts the other never rejects.
/// Highest accepted percentage value.
pub const PERCENT_MAX: u64 = 100;
/// Lowest accepted `concurrency.max_threads`.
pub const CONCURRENCY_MIN_THREADS: u64 = 1;
/// Highest accepted `concurrency.max_threads`.
pub const CONCURRENCY_MAX_THREADS_CEILING: u64 = 256;
/// Lowest accepted `concurrency.ram_fraction_percent`.
pub const RAM_FRACTION_PERCENT_MIN: u64 = 1;
/// Lowest accepted `lock.acquire_timeout_ms`, in milliseconds.
pub const LOCK_MIN_ACQUIRE_TIMEOUT_MS: u64 = 100;
/// Highest accepted `lock.acquire_timeout_ms` (one hour), in milliseconds.
pub const LOCK_MAX_ACQUIRE_TIMEOUT_MS: u64 = 3_600_000;
/// Lowest accepted `retry.base_ms`, `retry.max_ms` and `retry.max_elapsed_ms`.
pub const RETRY_MIN_MS: u64 = 1;
/// Highest accepted `retry.base_ms` and `retry.max_ms` (one minute).
pub const RETRY_MAX_WAIT_CEILING_MS: u64 = 60_000;
/// Highest accepted `retry.max_elapsed_ms` (one hour).
pub const RETRY_MAX_ELAPSED_CEILING_MS: u64 = 3_600_000;
/// Lowest accepted `search.max_inflight_bytes` (4 MiB).
///
/// The `search` pipeline also raises the effective budget to what its workers
/// need (`SEARCH_BUDGET_BYTES_PER_WORKER` per worker), so a value above this
/// minimum never starves it.
pub const SEARCH_MIN_INFLIGHT_BYTES: u64 = 4 * 1024 * 1024;
/// Highest accepted `search.max_inflight_bytes` (1 GiB).
pub const SEARCH_MAX_INFLIGHT_CEILING_BYTES: u64 = 1024 * 1024 * 1024;
/// Highest accepted `extract.max_sample_rows`.
pub const EXTRACT_MAX_SAMPLE_ROWS_CEILING: u64 = 100_000;
/// Highest accepted `extract.max_text_chars`.
pub const EXTRACT_MAX_TEXT_CHARS_CEILING: u64 = 10_000_000;
/// Highest accepted `extract.max_sheets` and `extract.max_slides`.
pub const EXTRACT_MAX_PARTS_CEILING: u64 = 10_000;
const _: = assert!;
const _: = assert!;
const _: = assert!;
const _: = assert!;
const _: = assert!;
const _: = assert!;
const _: =
assert!;
const _: = assert!;
const _: = assert!;