blob: bd570e30eed37e73cd703886bfd1eef684c90305 (
plain)
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
|
use super::group::{Group, GroupId};
pub struct TestGroup {
id: GroupId,
name: String,
}
impl Group for TestGroup {
fn id(&self) -> GroupId {
self.id
}
fn name(&self) -> String {
self.name.clone()
}
fn run(&self) {
let id = self.id;
let name = self.name.to_owned();
std::thread::spawn(move || /*loop { println!("> group nr.{} wishes you: '{}'", id, name) }*/());
}
}
impl TestGroup {
pub fn new(id: GroupId, name: String) -> Self {
TestGroup { id, name }
}
}
|