pub struct FileUtils;Expand description
File utilities for RAG operations
Implementations§
Source§impl FileUtils
impl FileUtils
Sourcepub async fn write_text_file<P: AsRef<Path>>(
path: P,
content: &str,
) -> Result<()>
pub async fn write_text_file<P: AsRef<Path>>( path: P, content: &str, ) -> Result<()>
Write text file
Sourcepub async fn file_exists<P: AsRef<Path>>(path: P) -> bool
pub async fn file_exists<P: AsRef<Path>>(path: P) -> bool
Check if file exists
Sourcepub async fn list_files<P: AsRef<Path>>(dir: P) -> Result<Vec<PathBuf>>
pub async fn list_files<P: AsRef<Path>>(dir: P) -> Result<Vec<PathBuf>>
List files in directory
Sourcepub async fn read_json_file<T: for<'de> Deserialize<'de>, P: AsRef<Path>>(
path: P,
) -> Result<T>
pub async fn read_json_file<T: for<'de> Deserialize<'de>, P: AsRef<Path>>( path: P, ) -> Result<T>
Read JSON file
Auto Trait Implementations§
impl Freeze for FileUtils
impl RefUnwindSafe for FileUtils
impl Send for FileUtils
impl Sync for FileUtils
impl Unpin for FileUtils
impl UnwindSafe for FileUtils
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