use std::future::Future;
use std::pin::Pin;
use std::sync::Arc;
use trait_kit::AsyncKit;
use trait_kit::prelude::*;
pub struct LoggerModule;
impl ModuleMeta for LoggerModule {
const NAME: &'static str = "inklog_logger";
const VERSION: &'static str = env!("CARGO_PKG_VERSION");
fn dependencies() -> &'static [(&'static str, std::any::TypeId)] {
&[]
}
}
impl AsyncAutoBuilder for LoggerModule {
type Capability = Arc<inklog::LoggerManager>;
type Error = TraitKitError;
fn build<'a>(
kit: &'a AsyncKit,
) -> Pin<Box<dyn Future<Output = Result<Self::Capability, Self::Error>> + Send + 'a>> {
Box::pin(async move { kit.config::<Self::Capability>() })
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_logger_module_compiles() {
let _ = LoggerModule;
}
}