Struct grouper_lib::files::FileHandler
source · 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 copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
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