singleton_stepanov/
lib.rs1use std::fmt::Debug;
2
3#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
4pub struct Singleton<T> {
5 value: T,
6}
7impl<T: Debug> Singleton<T> {
8 pub fn new(value: T) -> Self {
9 Self { value }
10 }
11}
12
13#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
14pub struct SemiRegular<T> {
15 value: T,
16}
17impl<T: Debug + Clone> SemiRegular<T> {
18 pub fn new(value: T) -> Self {
19 Self { value }
20 }
21}
22
23#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
24pub struct Regular<T> {
25 value: T,
26}
27impl<T: Debug + Clone + Eq> Regular<T> {
28 pub fn new(value: T) -> Self {
29 Self { value }
30 }
31}
32
33#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
34pub struct TotallyOrdered<T> {
35 value: T,
36}
37impl<T: Debug + Clone + Eq + Ord> TotallyOrdered<T> {
38 pub fn new(value: T) -> Self {
39 Self { value }
40 }
41}