tfrecord/indexer/
mod.rs

1//! The indexer that enumerate record locations from one or multiple TFRecord files.
2
3mod sync;
4pub use sync::*;
5
6#[cfg(feature = "async")]
7mod r#async;
8#[cfg(feature = "async")]
9pub use r#async::*;
10
11use std::{path::PathBuf, sync::Arc};
12
13/// The file path and record position in file.
14#[derive(Debug, Clone, PartialEq, Eq, Hash)]
15pub struct RecordIndex {
16    pub path: Arc<PathBuf>,
17    pub offset: u64,
18    pub len: usize,
19}
20
21/// Record position in file.
22#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
23pub struct Position {
24    pub offset: u64,
25    pub len: usize,
26}
27
28/// Configuration for indexer methods.
29#[derive(Debug, Clone, PartialEq, Eq, Hash)]
30pub struct RecordIndexerConfig {
31    pub check_integrity: bool,
32}
33
34impl Default for RecordIndexerConfig {
35    fn default() -> Self {
36        Self {
37            check_integrity: true,
38        }
39    }
40}