pub fn logfile_mut(&mut self, path: &PathBuf, def: &LogFileDef) -> AppResult<&mut LogFile> {
        // is logfile already in the snapshot ?
        if !self.snapshot.contains_key(path) {
            // create a new LogFile
            trace!(
                "snapshot is not containing path {:?}, creating a new entry",
                path
            );
            let logfile = LogFile::from_path(&path, Some(def.clone()))?;
            let opt = self.snapshot.insert(path.clone(), logfile);
            debug_assert!(opt.is_none());
            debug_assert!(self.snapshot.contains_key(path));
        }
        debug_assert!(self.snapshot.contains_key(path));
        debug_assert!(self.snapshot.get_mut(path).is_some());

        // get element mutable ref and set missing fields
        let logfile = self.snapshot.get_mut(path).unwrap();
        logfile.set_definition(def.clone());

        trace!("created logfile struct: {:#?}", logfile);

        Ok(logfile)
    }
/// Creates a new `LogfiFile` struct if not found, or retrieve an already stored one in
/// the snapshot.
Creates a new `LogfiFile` struct if not found, or retrieve an already stored one in
the snapshot.
Creates a new ` LogfiFile ` struct if not found or retrieve an already stored one in the snapshot .
pub fn logfile_mut(&mut self, path: &PathBuf, def: &LogFileDef) -> AppResult<&mut LogFile> {
        // is logfile already in the snapshot ?
        if !self.snapshot.contains_key(path) {
            // create a new LogFile
            trace!(
                "snapshot is not containing path {:?}, creating a new entry",
                path
            );
            let logfile = LogFile::from_path(&path, Some(def.clone()))?;
            let opt = self.snapshot.insert(path.clone(), logfile);
            debug_assert!(opt.is_none());
            debug_assert!(self.snapshot.contains_key(path));
        }
        debug_assert!(self.snapshot.contains_key(path));
        debug_assert!(self.snapshot.get_mut(path).is_some());
        // get element mutable ref and set missing fields
        let logfile = self.snapshot.get_mut(path).unwrap();
        logfile.set_definition(def.clone());
        trace!("created logfile struct: {:#?}", logfile);
        Ok(logfile)
    }
pub fn logfile_mut ( & mut self , path : & PathBuf , def : & LogFileDef ) -> AppResult < & mut LogFile > { // is logfile already in the snapshot ? if ! self . snapshot . contains_key ( path ) { // create a new LogFile trace ! ( " " path ) ; let logfile = LogFile :: from_path ( & path , Some ( def . clone ( ) ) ) ? ; let opt = self . snapshot . insert ( path . clone ( ) , logfile ) ; debug_assert ! ( opt is_none ( ) ) ; debug_assert ! ( self snapshot contains_key ( path ) ) ; } debug_assert ! ( self snapshot contains_key ( path ) ) ; debug_assert ! ( self snapshot get_mut ( path ) is_some ( ) ) ; // get element mutable ref and set missing fields let logfile = self . snapshot . get_mut ( path ) . unwrap ( ) ; logfile . set_definition ( def . clone ( ) ) ; trace ! ( " " logfile ) ; Ok ( logfile ) }
Creates a new `LogfiFile` struct if not found, or retrieve an already stored one in
the snapshot.
Creates a new ` LogfiFile ` struct if not found or retrieve an already stored one in the snapshot .
&mut self
path
&PathBuf
def
&LogFileDef
&mut self
path
&PathBuf
def
&LogFileDef