pub(crate) fn acquire<P: AsRef<Path>>(path: P) -> PidFileOutcome {
        match PidFile::new(path) {
            Ok(pidfile) => {
                if pidfile.unclean_shutdown() {
                    PidFileOutcome::Crashed(pidfile)
                } else {
                    PidFileOutcome::Clean(pidfile)
                }
            }
            Err(err @ PidFileError::LockFailed(_)) => PidFileOutcome::AnotherNodeRunning(err),
            Err(err) => PidFileOutcome::PidFileError(err),
        }
    }
/// Acquire a `PidFile` and give an actionable outcome.
///
/// **Important**: This function should be called **before** opening whatever resources it is
/// protecting.
Acquire a `PidFile` and give an actionable outcome.
Acquire a ` PidFile ` and give an actionable outcome .
pub(crate) fn acquire<P: AsRef<Path>>(path: P) -> PidFileOutcome {
        match PidFile::new(path) {
            Ok(pidfile) => {
                if pidfile.unclean_shutdown() {
                    PidFileOutcome::Crashed(pidfile)
                } else {
                    PidFileOutcome::Clean(pidfile)
                }
            }
            Err(err @ PidFileError::LockFailed(_)) => PidFileOutcome::AnotherNodeRunning(err),
            Err(err) => PidFileOutcome::PidFileError(err),
        }
    }
pub ( crate ) fn acquire < P : AsRef < Path > > ( path : P ) -> PidFileOutcome { match PidFile :: new ( path ) { Ok ( pidfile ) => { if pidfile . unclean_shutdown ( ) { PidFileOutcome :: Crashed ( pidfile ) } else { PidFileOutcome :: Clean ( pidfile ) } } Err ( err @ PidFileError :: LockFailed ( _ ) ) => PidFileOutcome :: AnotherNodeRunning ( err ) , Err ( err ) => PidFileOutcome :: PidFileError ( err ) , } }
Acquire a `PidFile` and give an actionable outcome.
Acquire a ` PidFile ` and give an actionable outcome .
path
P
path
P