#[doc(inline)]
pub use self::{constants::*, types::*};
pub type Result<T = ()> = anyhow::Result<T>;
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";
}
mod types {
pub use bson::oid::ObjectId;
pub use config::{ConfigBuilder, ConfigError};
use std::{
collections::HashMap,
sync::{Arc, Mutex},
};
pub type AsyncError = Box<dyn std::error::Error + Send + Sync>;
pub type AsyncResult<T = ()> = std::result::Result<T, AsyncError>;
pub type BoxError = Box<dyn std::error::Error>;
pub type BoxResult<T = (), E = BoxError> = std::result::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>;
}