spacegate-config 0.2.0-alpha.4

A library-first, lightweight, high-performance, cloud-native supported API gateway
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::ffi::OsStr;
pub mod json;
pub mod toml;
// pub mod yaml;

pub trait ConfigFormat {
    fn extension(&self) -> &OsStr;
    fn de<T: serde::de::DeserializeOwned>(&self, slice: &[u8]) -> Result<T, BoxError>;
    fn ser<T: serde::Serialize>(&self, t: &T) -> Result<Vec<u8>, BoxError>;
}

use crate::BoxError;
pub use json::Json;
pub use toml::Toml;