1pub mod audit;
2pub mod env_config;
3pub mod formatter;
4
5pub use audit::{AuditConfig, AuditLevel, Module};
6pub use env_config::{audit_config_from_env, AuditSink, EnvAuditConfig, SchemaMode};
7pub use formatter::{AuditFormatter, AuditDetail};
8
9use thiserror::Error;
10
11#[derive(Debug, Error)]
13pub enum TeaQLToolError {
14 #[error("Parse Error: {0}")]
15 ParseError(String),
16
17 #[error("Invalid Argument: {0}")]
18 InvalidArgument(String),
19
20 #[error("Execution Error: {0}")]
21 ExecutionError(String),
22
23 #[error("Not Supported: {0}")]
24 NotSupported(String),
25}
26
27pub type Result<T> = std::result::Result<T, TeaQLToolError>;
29
30#[repr(transparent)]
34pub struct MustPurpose<T> {
35 value: T,
36}
37
38impl<T> MustPurpose<T> {
39 #[inline(always)]
41 pub fn new(value: T) -> Self {
42 Self { value }
43 }
44
45 #[inline(always)]
48 pub fn purpose(self, _desc: impl Into<String>) -> T {
49 self.value
50 }
51}
52
53impl<T: std::fmt::Debug> std::fmt::Debug for MustPurpose<T> {
54 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
55 std::fmt::Debug::fmt(&self.value, f)
56 }
57}