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
/*
    Appellation: primitives <module>
    Creator: FL03 <jo3mccain@icloud.com>
    Description:
        This module is dedicated to developing a set of primitives to be used throughout our
        ecosystem
*/
pub use crate::{crypto::hashes::primitives::*, errors::primitives::*, states::primitives::*};
pub use config::{AsyncConfigBuilder, ConfigBuilder, ConfigError};

pub const SCASE: &str = "snake_case";
pub const DEFAULT_HTTP_PORT: u16 = 8080;

/// Type alias of a result implementing the [BaseError]
pub type Result<T = (), E = BaseError> = std::result::Result<T, E>;
/// Type alias for the standard result used
pub type BoxResult<T = (), E = BoxError> = Result<T, E>;
/// Type alias for [bson::DateTime]
pub type BsonDateTime = bson::DateTime;
/// Type alias for [bson::oid::ObjectId]
pub type BsonOid = bson::oid::ObjectId;
/// Type alias for [config::Environment]
pub type ConfigEnvironment = config::Environment;
/// Type alias for [config::File]
pub type ConfigFile<Src, Fmt> = config::File<Src, Fmt>;
/// Type alias for a collection of [crate::ConfigFile]
pub type ConfigFileVec = Vec<ConfigFile<config::FileSourceFile, config::FileFormat>>;
/// Type alias for a configuration result
pub type ConfigResult<T> = Result<T, ConfigError>;
/// Type alias for [std::collections::HashMap] defaulting to a (String, String) type
pub type Dictionary<K = String, V = String> = std::collections::HashMap<K, V>;
/// Type alias for [chrono::DateTime]
pub type ChronoDateTime<T = DefaultTimezone> = chrono::DateTime<T>;
/// Type alias for [config::ConfigBuilder]
pub type DefaultConfigBuilder = super::ConfigBuilder<DefaultConfigBuilderState>;
/// Type alias for [config::builder::DefaultState]
pub type DefaultConfigBuilderState = config::builder::DefaultState;
/// Type alias for the default timestamp
pub type DefaultTimestamp = i64;
/// Type alias for the default timezone, [chrono::Utc]
pub type DefaultTimezone = chrono::Utc;
/// Type alias for [std::io::Result]
pub type IOResult<T = ()> = std::io::Result<T>;