async_callback_manager/
constraint.rs1#[derive(Eq, PartialEq, Debug)]
2pub struct Constraint<Cstrnt> {
3 pub(crate) constraint_type: ConstraitType<Cstrnt>,
4}
5
6impl<Cstrnt> Constraint<Cstrnt> {
7 pub fn new_block_same_type() -> Self {
8 Self {
9 constraint_type: ConstraitType::BlockSameType,
10 }
11 }
12 pub fn new_kill_same_type() -> Self {
13 Self {
14 constraint_type: ConstraitType::KillSameType,
15 }
16 }
17 pub fn new_block_matching_metadata(metadata: Cstrnt) -> Self {
18 Self {
19 constraint_type: ConstraitType::BlockMatchingMetatdata(metadata),
20 }
21 }
22}
23
24#[derive(Eq, PartialEq, Debug)]
25pub enum ConstraitType<Cstrnt> {
26 BlockSameType,
27 KillSameType,
28 BlockMatchingMetatdata(Cstrnt),
29}