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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#[doc(inline)]
pub use self::{constants::*, types::*};
pub type Result<T = ()> = anyhow::Result<T>;
pub(crate) mod constants {
pub const SCASE: &str = "snake_case";
pub const DEFAULT_HTTP_PORT: u16 = 8080;
pub const DEFAULT_IGNORE_CHARS: &[char] = &['[', ']', ',', '.', ' '];
pub const LOCALHOST: [u8; 4] = [127, 0, 0, 1];
pub const LOCALHOST_STR: &str = "127.0.0.1";
}
pub(crate) mod types {
use std::{
collections::HashMap,
sync::{Arc, Mutex},
};
pub use config::{AsyncConfigBuilder, ConfigBuilder, ConfigError};
pub type AsyncError = Box<dyn std::error::Error + Send + Sync>;
pub type AsyncResult<T = ()> = Result<T, AsyncError>;
pub type BoxError = Box<dyn std::error::Error>;
pub type BoxResult<T = (), E = BoxError> = Result<T, E>;
pub type BsonDateTime = bson::DateTime;
pub type BsonOid = bson::oid::ObjectId;
pub type ConfigEnvironment = config::Environment;
pub type ConfigFile<Src, Fmt> = config::File<Src, Fmt>;
pub type ConfigFileVec = Vec<ConfigFile<config::FileSourceFile, config::FileFormat>>;
pub type ConfigResult<T> = Result<T, config::ConfigError>;
pub type Dictionary<K = String, V = String> = HashMap<K, V>;
pub type ChronoDateTime<T = DefaultTimezone> = chrono::DateTime<T>;
pub type DefaultConfigBuilder = super::ConfigBuilder<DefaultConfigBuilderState>;
pub type DefaultConfigBuilderState = config::builder::DefaultState;
pub type DefaultTimestamp = i64;
pub type DefaultTimezone = chrono::Utc;
pub type Locked<T> = Arc<Mutex<T>>;
pub type IOResult<T = ()> = std::io::Result<T>;
pub type StateMap<Hs, V = (usize, usize)> = HashMap<Hs, V>;
}