fn register_file_as_managed(&self, filepath: &Path) -> io::Result<()> {
        // Files starting by "." (e.g. lock files) are not managed.
        if !is_managed(filepath) {
            return Ok(());
        }
        let mut meta_wlock = self
            .meta_informations
            .write()
            .expect("Managed file lock poisoned");
        let has_changed = meta_wlock.managed_paths.insert(filepath.to_owned());
        if has_changed {
            save_managed_paths(self.directory.as_ref(), &meta_wlock)?;
        }
        Ok(())
    }
/// Registers a file as managed
///
/// This method must be called before the file is
/// actually created to ensure that a failure between
/// registering the filepath and creating the file
/// will not lead to garbage files that will
/// never get removed.
///
/// File starting by "." are reserved to locks.
/// They are not managed and cannot be subjected
/// to garbage collection.
Registers a file as managed
This method must be called before the file is
actually created to ensure that a failure between
registering the filepath and creating the file
will not lead to garbage files that will
never get removed.

File starting by "." are reserved to locks.
They are not managed and cannot be subjected
to garbage collection.
Registers a file as managed This method must be called before the file is actually created to ensure that a failure between registering the filepath and creating the file will not lead to garbage files that will never get removed . File starting by " . " are reserved to locks . They are not managed and cannot be subjected to garbage collection .
fn register_file_as_managed(&self, filepath: &Path) -> io::Result<()> {
        // Files starting by "." (e.g. lock files) are not managed.
        if !is_managed(filepath) {
            return Ok(());
        }
        let mut meta_wlock = self
            .meta_informations
            .write()
            .expect("Managed file lock poisoned");
        let has_changed = meta_wlock.managed_paths.insert(filepath.to_owned());
        if has_changed {
            save_managed_paths(self.directory.as_ref(), &meta_wlock)?;
        }
        Ok(())
    }
fn register_file_as_managed ( & self , filepath : & Path ) -> io :: Result < ( ) > { // Files starting by "." (e.g. lock files) are not managed. if ! is_managed ( filepath ) { return Ok ( ( ) ) ; } let mut meta_wlock = self . meta_informations . write ( ) . expect ( " " ) ; let has_changed = meta_wlock . managed_paths . insert ( filepath . to_owned ( ) ) ; if has_changed { save_managed_paths ( self . directory . as_ref ( ) , & meta_wlock ) ? ; } Ok ( ( ) ) }
Registers a file as managed
This method must be called before the file is
actually created to ensure that a failure between
registering the filepath and creating the file
will not lead to garbage files that will
never get removed.
Registers a file as managed This method must be called before the file is actually created to ensure that a failure between registering the filepath and creating the file will not lead to garbage files that will never get removed .
&self
filepath
&Path
&self
filepath
&Path