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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//! # Core Data Types
//!
//! This module defines the fundamental data types and structures used throughout the
//! BugguDB system. These types provide a consistent and efficient representation for
//! key entities such as tokens, document IDs, and log entries.
use ;
/// Represents a token, which is a fundamental unit of information in the search index.
///
/// A token is typically a word, a phrase, or an attribute extracted from a log entry.
/// It is represented as a `u64` for efficient storage and lookup.
pub type Tok = u64;
/// A unique identifier for a document, which corresponds to a single log entry.
///
/// Each document in the database is assigned a unique `DocId` to allow for precise
/// retrieval and management.
pub type DocId = u64;
/// Defines the tokenization mode for a log entry.
///
/// This enum allows for different strategies when processing log content, enabling
/// a balance between structured data extraction and full-text indexing.
/// Represents a single log entry with its associated metadata.
///
/// This struct is the primary data structure for storing log information. It includes
/// the raw content, a timestamp, and optional fields for log level and service name.
/// Returns the current time in seconds since the Unix epoch.
///
/// This is a convenience function for creating timestamps for log entries.