use super::*;
#[derive(Debug, Clone)]
pub struct TextLoader {
content: String,
}
impl TextLoader {
pub fn new<T: Into<String>>(input: T) -> Self {
Self { content: input.into() }
}
}
impl Loader for TextLoader {
fn load(self) -> LoaderResult<Vec<Document>> {
let doc = Document::new(self.content);
Ok(vec![doc])
}
}