submap/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#![ doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "README.md" ) ) ]
mod submap;
pub use crate::submap::SubMap;

mod broadcastmap;
pub use crate::broadcastmap::BroadcastMap;

mod aclmap;
pub use crate::aclmap::AclMap;

#[cfg(feature = "digest")]
pub mod digest;

#[cfg(feature = "native-digest")]
#[path = "native_digest.rs"]
pub mod digest;

pub mod mkmf;

#[cfg(not(feature = "indexmap"))]
pub mod types {
    use std::collections::{BTreeMap, BTreeSet};

    pub type Set<V> = BTreeSet<V>;
    pub type Map<K, V> = BTreeMap<K, V>;
    pub trait Client: Ord + Eq + Clone {}
    impl<T: Ord + Eq + Clone> Client for T {}

    pub const ENGINE: &str = "std-btree";
}

#[cfg(feature = "indexmap")]
pub mod types {
    use indexmap::{IndexMap, IndexSet};
    use std::hash::Hash;

    pub type Set<V> = IndexSet<V>;
    pub type Map<K, V> = IndexMap<K, V>;
    pub trait Client: Ord + Eq + Clone + Hash {}
    impl<T: Ord + Eq + Clone + Hash> Client for T {}

    pub const ENGINE: &str = "indexmap";
}

#[derive(thiserror::Error, Debug)]
pub enum Error {
    #[error("formula parse: {0}")]
    FormulaParseError(String),
}