pub struct TextLoader {
pub path: PathBuf,
pub split_by_line: bool,
}Expand description
Text document loader
Supports loading plain-text files (.txt), treating the entire file content as one document.
Fields§
§path: PathBufText file path
split_by_line: boolWhether to split by line (optional) If true, each line is returned as a separate document
Implementations§
Source§impl TextLoader
impl TextLoader
Sourcepub fn new_with_line_split(path: impl Into<PathBuf>) -> Self
pub fn new_with_line_split(path: impl Into<PathBuf>) -> Self
Creates a line-splitting Text loader
Each line is returned as a separate document.
§Arguments
path- the text file path
Sourcepub fn with_split_by_line(self, split: bool) -> Self
pub fn with_split_by_line(self, split: bool) -> Self
Sets whether to split by line
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextLoader
impl RefUnwindSafe for TextLoader
impl Send for TextLoader
impl Sync for TextLoader
impl Unpin for TextLoader
impl UnsafeUnpin for TextLoader
impl UnwindSafe for TextLoader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more