contained_core/tasks/
mod.rs

1/*
2    Appellation: tasks <module>
3    Contrib: FL03 <jo3mccain@icloud.com>
4    Description: ... summary ...
5*/
6pub use self::{manager::*, registry::*};
7
8mod manager;
9mod registry;
10
11use serde::{Deserialize, Serialize};
12
13#[derive(Clone, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
14pub struct Task {
15    group: String,
16    name: String,
17}
18
19impl Task {
20    pub fn new(group: impl ToString, name: impl ToString) -> Self {
21        Self {
22            group: group.to_string(),
23            name: name.to_string(),
24        }
25    }
26}
27
28impl std::fmt::Display for Task {
29    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
30        write!(f, "{}:{}", self.group, self.name)
31    }
32}