pub struct FileReader { /* private fields */ }
Implementations§
Source§impl FileReader
impl FileReader
Sourcepub fn new(app_folder: String) -> Self
pub fn new(app_folder: String) -> Self
Creates a new file-reader for reading files from the app dir with the provided name
Sourcepub fn read_file_to_string(&mut self, file_name: String) -> String
pub fn read_file_to_string(&mut self, file_name: String) -> String
Reads a string from a file contained in the app directory of the cli application
Sourcepub fn write_string_to_file(&mut self, file_name: String, content: String)
pub fn write_string_to_file(&mut self, file_name: String, content: String)
Writes string content to the file with the provided file name and closes it after the write process
Auto Trait Implementations§
impl Freeze for FileReader
impl RefUnwindSafe for FileReader
impl Send for FileReader
impl Sync for FileReader
impl Unpin for FileReader
impl UnwindSafe for FileReader
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