use crate::host::{Bytes, feature, handler};
pub fn enable(feature: feature::Feature) -> i32 {
handler::enable_feature(feature.into())
}
pub fn config() -> Bytes {
Bytes::from(handler::get_config())
}
#[cfg(feature = "log")]
mod host_logger;
#[cfg(feature = "log")]
pub use host_logger::{init_log, init_log_with_level};
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn admin_config() {
let config = config();
let config_str = config.to_str().unwrap();
assert!(config_str.contains("config"));
assert!(config_str.contains("test1"));
}
#[test]
fn admin_enable_feature() {
let _result = enable(feature::BufferRequest);
}
#[test]
fn admin_enable_combined_features() {
let combined = feature::BufferRequest | feature::BufferResponse;
let _result = enable(combined);
}
}