#![cfg_attr(not(unix), allow(unused_imports))] mod configuration; use configuration::ConfigurationService; use fundamentum_edge_proto::com::fundamentum::edge::v1::configuration_server::ConfigurationServer; use tonic::transport::Server; #[cfg(unix)] #[tokio::main] async fn main() -> Result<(), Box> { use tokio::net::UnixListener; use tokio_stream::wrappers::UnixListenerStream; let uds = UnixListener::bind("/tmp/socket")?; let uds_stream = UnixListenerStream::new(uds); let configuration_svc = ConfigurationService::new(); let router = Server::builder().add_service(ConfigurationServer::new(configuration_svc)); router.serve_with_incoming(uds_stream).await?; Ok(()) } #[cfg(not(unix))] fn main() { panic!("`uds` only works on unix systems!"); }