1#![deny(warnings)]
12#![deny(clippy::all)]
13#![deny(clippy::pedantic)]
14#![deny(unreachable_pub)]
15#![deny(unused_allocation)]
16#![deny(unused_extern_crates)]
17#![deny(unused_assignments)]
18#![deny(unused_comparisons)]
19#![allow(clippy::cast_possible_wrap)]
20#![allow(clippy::cast_sign_loss)]
21#![allow(clippy::default_trait_access)] #![allow(clippy::float_cmp)]
23#![allow(clippy::match_wildcard_for_single_variants)]
24#![allow(clippy::module_name_repetitions)]
25#![allow(clippy::must_use_candidate)] #![allow(clippy::non_ascii_literal)] #![allow(clippy::unnested_or_patterns)] #![allow(clippy::type_complexity)] pub mod config;
31pub mod event;
32pub mod fanout;
33pub mod ipallowlist;
34pub mod metrics;
35pub mod partition;
36pub mod schema;
37pub mod serde;
38pub mod sink;
39pub mod source;
40pub mod tcp;
41#[cfg(test)]
42mod test_util;
43pub mod time;
44pub mod tls;
45pub mod transform;
46#[cfg(feature = "vrl")]
47pub mod vrl;
48
49use float_eq::FloatEq;
50use std::path::PathBuf;
51
52#[cfg(feature = "vrl")]
53pub use crate::vrl::compile_vrl;
54
55pub use event::EstimatedJsonEncodedSizeOf;
56
57#[macro_use]
58extern crate tracing;
59
60pub fn default_data_dir() -> Option<PathBuf> {
61 Some(PathBuf::from("/var/lib/vector/"))
62}
63
64pub(crate) use vector_common::{Error, Result};
65
66pub(crate) fn float_eq(l_value: f64, r_value: f64) -> bool {
67 (l_value.is_nan() && r_value.is_nan()) || l_value.eq_ulps(&r_value, &1)
68}
69
70#[cfg(feature = "test")]
73#[macro_export]
74macro_rules! emit {
75 ($event:expr) => {
76 vector_lib::internal_event::emit(vector_lib::internal_event::DefaultName {
77 event: $event,
78 name: stringify!($event),
79 })
80 };
81}
82
83#[cfg(not(feature = "test"))]
84#[macro_export]
85macro_rules! emit {
86 ($event:expr) => {
87 vector_lib::internal_event::emit($event)
88 };
89}
90
91#[cfg(feature = "test")]
92#[macro_export]
93macro_rules! register {
94 ($event:expr) => {
95 vector_lib::internal_event::register(vector_lib::internal_event::DefaultName {
96 event: $event,
97 name: stringify!($event),
98 })
99 };
100}
101
102#[cfg(not(feature = "test"))]
103#[macro_export]
104macro_rules! register {
105 ($event:expr) => {
106 vector_lib::internal_event::register($event)
107 };
108}