Skip to main content

Crate single_instance

Crate single_instance 

Source
Expand description

A rust library for single instance application.

single-instance provides a single API to check if there are any other running instance.

§Detail

On linux init will bind abstract unix domain socket with given name . On macos, init will create or open a file which path is given &str, then call flock to apply an advisory lock on the open file.

§Examples

extern crate single_instance;

use std::thread;
use single_instance::SingleInstance;

fn main() {
    let instance = SingleInstance::new("whatever").unwrap();
    assert!(instance.is_single());
}

Structs§

SingleInstance
A struct representing one running instance.

Enums§

Error