daemon 0.0.6

Library for simple creating Linux demons and Windows services.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::sync::mpsc::Receiver;
use std::io::Error;

pub enum State {
	Start,
	Reload,
	Stop,
}

pub struct Daemon {
	// Daemon name
	pub name: String,
}

pub trait DaemonRunner {
	fn run<F: 'static + FnOnce(Receiver<State>)>(&self, f: F) -> Result<(), Error>;
}