rig/loaders/
mod.rs

1//! This module provides utility structs for loading and preprocessing files.
2//!
3//! The [FileLoader] struct can be used to define a common interface for loading any type of files from disk,
4//! as well as performing minimal preprocessing on the files, such as reading their contents, ignoring errors
5//! and keeping track of file paths along with their contents.
6//!
7//! The [PdfFileLoader] works similarly to the [FileLoader], but is specifically designed to load PDF
8//! files. This loader also provides PDF-specific preprocessing methods for splitting the PDF into pages
9//! and keeping track of the page numbers along with their contents.
10//!
11//! Note: The [PdfFileLoader] requires the `pdf` feature to be enabled in the `Cargo.toml` file.
12//!
13//! The [EpubFileLoader] works similarly to the [FileLoader], but is specifically designed to load EPUB
14//! files. This loader also provides EPUB-specific preprocessing methods for splitting the EPUB into chapters
15//! and keeping track of the chapter numbers along with their contents.
16//!
17//! Note: The [EpubFileLoader] requires the `epub` feature to be enabled in the `Cargo.toml` file.
18
19pub mod file;
20
21pub use file::FileLoader;
22
23#[cfg(feature = "pdf")]
24pub mod pdf;
25
26#[cfg(feature = "pdf")]
27pub use pdf::PdfFileLoader;
28
29#[cfg(feature = "epub")]
30pub mod epub;
31
32#[cfg(feature = "epub")]
33pub use epub::{EpubFileLoader, RawTextProcessor, StripXmlProcessor, TextProcessor};