matchmaker/
lib.rs

1// event
2pub mod config;
3pub mod binds;
4pub mod action;
5pub mod event;
6
7pub mod message;
8#[allow(unused)]
9pub mod render;
10pub mod ui;
11// picker
12pub mod nucleo;
13pub mod spawn;
14mod selection;
15pub use selection::SelectionSet;
16mod matchmaker;
17pub use matchmaker::*;
18pub mod tui;
19
20// misc
21mod utils;
22mod aliases;
23pub mod errors;
24pub use aliases::*;
25pub use errors::*;
26
27#[macro_export]
28macro_rules! impl_int_wrapper {
29    ($name:ident, $inner:ty, $default:expr) => {
30        #[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize)]
31        pub struct $name(pub $inner);
32        
33        impl Default for $name {
34            fn default() -> Self {
35                $name($default)
36            }
37        }
38        
39        impl std::str::FromStr for $name {
40            type Err = std::num::ParseIntError;
41            
42            fn from_str(s: &str) -> Result<Self, Self::Err> {
43                Ok($name(s.parse()?))
44            }
45        }
46        
47        impl From<&$name> for $inner {
48            fn from(c: &$name) -> Self {
49                c.0
50            }
51        }
52    };
53}