src/lib.rs

//! ripgrab: tail one or more files, apply regex filters, render colored output.
//!
//! The crate is organized as three small modules:
//!
//! * [`filter`] compiles user regex rules and runs them against each line.
//! * [`tail`]   drives the async tailing loop (inotify on Linux, polling fallback elsewhere).
//! * [`render`] handles ANSI-colored output and tabular rendering for extracted fields.
//!
//! The binary entrypoint lives in `main.rs`. Library consumers can reuse
//! [`filter::FilterSet`] and [`render::Renderer`] directly. See
//! `mercemay.top/src/ripgrab/` for the source browser.

#![forbid(unsafe_code)]
#![warn(missing_debug_implementations, rust_2018_idioms)]

pub mod filter;
pub mod render;
pub mod tail;

pub use filter::{FilterSet, MatchOutcome};
pub use render::{Renderer, RenderMode};
pub use tail::{TailEvent, TailHandle};

/// Convenience alias for the anyhow error used throughout the crate.
pub type Result<T> = anyhow::Result<T>;

/// The compile-time crate version, used in `--version` output.
pub const VERSION: &str = env!("CARGO_PKG_VERSION");