fn lock(&mut self) -> Result<File, Error> {
        fs::create_dir_all(&self.work)?;
        let file = OpenOptions::new()
            .read(true)
            .write(true)
            .create(true)
            .open(self.work.join(".lock"))?;
        file.try_lock_exclusive()?;
        Ok(file)
    }
/// Locks execution of concurrent invocations of this script in case one
/// takes a long time to run. The call to `try_lock_exclusive` will fail if
/// the lock is held already
Locks execution of concurrent invocations of this script in case one
takes a long time to run. The call to `try_lock_exclusive` will fail if
the lock is held already
Locks execution of concurrent invocations of this script in case one takes a long time to run . The call to ` try_lock_exclusive ` will fail if the lock is held already
fn lock(&mut self) -> Result<File, Error> {
        fs::create_dir_all(&self.work)?;
        let file = OpenOptions::new()
            .read(true)
            .write(true)
            .create(true)
            .open(self.work.join(".lock"))?;
        file.try_lock_exclusive()?;
        Ok(file)
    }
fn lock ( & mut self ) -> Result < File , Error > { fs :: create_dir_all ( & self . work ) ? ; let file = OpenOptions :: new ( ) . read ( true ) . write ( true ) . create ( true ) . open ( self . work . join ( " " ) ) ? ; file . try_lock_exclusive ( ) ? ; Ok ( file ) }
Locks execution of concurrent invocations of this script in case one
takes a long time to run.
Locks execution of concurrent invocations of this script in case one takes a long time to run .
&mut self
&mut self