pub struct FileHandler {
pub temp_path: String,
}
Fields§
§temp_path: String
Implementations§
Source§impl FileHandler
impl FileHandler
pub fn new() -> FileHandler
pub fn init_base_dir(&self) -> Result<()>
pub fn read_and_return_json( &self, filename: &str, ) -> Result<String, Box<dyn Error>>
pub fn read_and_return_students( &self, filename: &str, ) -> Result<Vec<Student>, ()>
pub fn write_json( &self, data: Vec<Student>, filename: &str, ) -> Result<String, Box<dyn Error>>
pub fn delete_file(&self, filename: &str) -> Result<String, Box<dyn Error>>
pub fn read_directory(&self) -> Result<Vec<String>, Box<dyn Error>>
pub fn student_from_record( idx: usize, row: Result<StringRecord, Error>, ) -> Student
pub fn network_available() -> bool
pub fn temp_data_available(&self) -> bool
Trait Implementations§
Source§impl Clone for FileHandler
impl Clone for FileHandler
Source§fn clone(&self) -> FileHandler
fn clone(&self) -> FileHandler
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for FileHandler
impl Default for FileHandler
Source§impl<'de> Deserialize<'de> for FileHandler
impl<'de> Deserialize<'de> for FileHandler
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FileHandler
impl RefUnwindSafe for FileHandler
impl Send for FileHandler
impl Sync for FileHandler
impl Unpin for FileHandler
impl UnwindSafe for FileHandler
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