pub fn from_path<P: AsRef<Path>>(path: P, def: Option<LogFileDef>) -> AppResult<LogFile> {
        // create a default logfile and update it later. This is used to not duplicate code
        let mut logfile = LogFile::default();

        // if a definition is provided, assign it
        if let Some(definition) = def {
            logfile.definition = definition;
        }

        // now update all fields
        logfile.id.update(path, logfile.definition.hash_window)?;

        Ok(logfile)
    }
/// Creates a `LogFile` by providing the full logfile path. It also sets platform specific features
/// like file *inode* or *dev*. The file path is checked for accessibility and is canonicalized. It also
/// contains run time data, which correspond to the data created each time a logfile instance is searched
/// for patterns. If a definition is provided, assign it
Creates a `LogFile` by providing the full logfile path. It also sets platform specific features
like file *inode* or *dev*. The file path is checked for accessibility and is canonicalized. It also
contains run time data, which correspond to the data created each time a logfile instance is searched
for patterns. If a definition is provided, assign it
Creates a ` LogFile ` by providing the full logfile path . It also sets platform specific features like file * inode * or * dev * . The file path is checked for accessibility and is canonicalized . It also contains run time data which correspond to the data created each time a logfile instance is searched for patterns . If a definition is provided assign it
pub fn from_path<P: AsRef<Path>>(path: P, def: Option<LogFileDef>) -> AppResult<LogFile> {
        // create a default logfile and update it later. This is used to not duplicate code
        let mut logfile = LogFile::default();
        // if a definition is provided, assign it
        if let Some(definition) = def {
            logfile.definition = definition;
        }
        // now update all fields
        logfile.id.update(path, logfile.definition.hash_window)?;
        Ok(logfile)
    }
pub fn from_path < P : AsRef < Path > > ( path : P , def : Option < LogFileDef > ) -> AppResult < LogFile > { // create a default logfile and update it later. This is used to not duplicate code let mut logfile = LogFile :: default ( ) ; // if a definition is provided, assign it if let Some ( definition ) = def { logfile . definition = definition ; } // now update all fields logfile . id . update ( path , logfile . definition . hash_window ) ? ; Ok ( logfile ) }
Creates a `LogFile` by providing the full logfile path.
Creates a ` LogFile ` by providing the full logfile path .
path
P
def
Option<LogFileDef>
path
P
def
Option<LogFileDef>