mech_set/
lib.rs

1#![no_main]
2#![allow(warnings)]
3
4use indexmap::set::IndexSet;
5
6use mech_core::*;
7
8use paste::paste;
9
10use std::fmt::{Display, Debug};
11use std::marker::PhantomData;
12
13#[cfg(feature = "membership")]
14pub mod membership;
15#[cfg(feature = "modify")]
16pub mod modify;
17#[cfg(feature = "operations")]
18pub mod operations;
19#[cfg(feature = "relations")]
20pub mod relations;
21#[cfg(feature = "setdata")]
22pub mod setdata;
23
24#[cfg(feature = "membership")]
25pub use self::membership::*;
26#[cfg(feature = "modify")]
27pub use self::modify::*;
28#[cfg(feature = "operations")]
29pub use self::operations::*;
30#[cfg(feature = "relations")]
31pub use self::relations::*;
32#[cfg(feature = "setdata")]
33pub use self::setdata::*;
34
35
36// ----------------------------------------------------------------------------
37// Set Library
38// ----------------------------------------------------------------------------
39
40#[macro_export]
41macro_rules! register_set_fxns {
42  ($lib:ident, $($suffix:ident),* $(,)?) => {
43    paste::paste! {
44      $(
45        register_fxn_descriptor!([<$lib $suffix>],
46          i8, "i8",
47          i16, "i16",
48          i32, "i32",
49          i64, "i64",
50          i128, "i128",
51          u8, "u8",
52          u16, "u16",
53          u32, "u32",
54          u64, "u64",
55          u128, "u128",
56          F32, "f32",
57          F64, "f64",
58          C64, "c64",
59          R64, "r64" 
60        );
61      )*
62    }
63  };
64}
65
66#[macro_export]
67macro_rules! impl_set_fxns {
68  ($lib:ident) => {
69    impl_fxns!($lib,T,T,impl_binop);
70    register_set_fxns!($lib,
71        SS, SM1, SM2, SM3, SM4, SM2x3, SM3x2, SMD, SR2, SR3, SR4, SRD,
72        SV2, SV3, SV4, SVD, M1S, M2S, M3S, M4S, M2x3S, M3x2S, MDS,
73        R2S, R3S, R4S, RDS, V2S, V3S, V4S, VDS, M1M1, M2M2, M3M3, M4M4,
74        M2x3M2x3, M3x2M3x2, MDMD, M2V2, M3V3, M4V4, M2x3V2, M3x2V3, MDVD,
75        MDV2, MDV3, MDV4, V2M2, V3M3, V4M4, V2M2x3, V3M3x2, VDMD, V2MD,
76        V3MD, V4MD, M2R2, M3R3, M4R4, M2x3R3, M3x2R2, MDRD, MDR2, MDR3,
77        MDR4, R2M2, R3M3, R4M4, R3M2x3, R2M3x2, RDMD, R2MD, R3MD, R4MD,
78        R2R2, R3R3, R4R4, RDRD, V2V2, V3V3, V4V4, VDVD, Union
79    );
80  }}
81