system_update_configurator/
main.rs#![deny(missing_docs)]
#![allow(clippy::let_unit_value)]
#![allow(clippy::type_complexity)]
use anyhow::{Context, Error};
use fuchsia_component::server::ServiceFs;
use log::{error, info};
pub mod bridge;
mod health;
mod service;
#[fuchsia::main(logging = true)]
pub async fn main() -> Result<(), Error> {
info!("starting system-update-configurator");
if let Err(e) = run().await {
error!("error running system-update-configurator: {e:#}")
}
info!("shutting down system-update-configurator");
Ok(())
}
async fn run() -> Result<(), Error> {
let inspector = fuchsia_inspect::Inspector::default();
let _inspect_server_task =
inspect_runtime::publish(&inspector, inspect_runtime::PublishOptions::default());
let health_status = health::HealthStatus::new(inspector.root());
let mut fs: service::Fs = ServiceFs::new_local();
fs.take_and_serve_directory_handle().context("while taking outdir handle")?;
let storage = bridge::OptOutStorage;
let mut storage = health_status.wrap_bridge(storage);
service::serve(fs, &mut storage).await;
Ok(())
}