Skip to main content

qubit_fs/options/
checksum_policy.rs

1/*******************************************************************************
2 *
3 *    Copyright (c) 2026 Haixing Hu.
4 *
5 *    SPDX-License-Identifier: Apache-2.0
6 *
7 *    Licensed under the Apache License, Version 2.0.
8 *
9 ******************************************************************************/
10//! Checksum policy for read operations.
11
12/// Checksum behavior requested by a read operation.
13#[derive(Clone, Copy, Debug, Eq, PartialEq)]
14pub enum ChecksumPolicy {
15    /// Do not require checksum validation.
16    None,
17    /// Validate checksums when the provider can do so cheaply.
18    BestEffort,
19    /// Require checksum validation or fail.
20    Required,
21}
22
23impl Default for ChecksumPolicy {
24    /// Does not require checksum validation by default.
25    #[inline]
26    fn default() -> Self {
27        Self::None
28    }
29}