1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
use std::cell::RefCell;
use std::rc::Rc;

use super::*;

pub struct SystemdUnit {

	connection: Rc <RefCell <SystemdConnection>>,

	name: String,
	description: String,
	load_state: SystemdLoadState,
	active_state: SystemdActiveState,
	sub_state: SystemdSubState,
	following_unit: Option <String>,
	unit_object_path: String,
	job_id: u32,
	job_type: SystemdJobType,
	job_object_path: String,

}

impl SystemdUnit {

	pub fn new (
		connection: Rc <RefCell <SystemdConnection>>,
		name: String,
		description: String,
		load_state: SystemdLoadState,
		active_state: SystemdActiveState,
		sub_state: SystemdSubState,
		following_unit: Option <String>,
		unit_object_path: String,
		job_id: u32,
		job_type: SystemdJobType,
		job_object_path: String,
	) -> SystemdUnit {

		SystemdUnit {
			connection: connection,
			name: name,
			description: description,
			load_state: load_state,
			active_state: active_state,
			sub_state: sub_state,
			following_unit: following_unit,
			unit_object_path: unit_object_path,
			job_id: job_id,
			job_type: job_type,
			job_object_path: job_object_path,
		}

	}

	pub fn name (& self) -> & str {
		& self.name
	}

	pub fn description (& self) -> & str {
		& self.name
	}

}

// ex: noet ts=4 filetype=rust