//! Binary entry point. The active filesystem backend is picked at compile //! time by Cargo features (see [`subtext::backend`]); this file is otherwise //! feature-agnostic. use fskit_rs::MountOptions; use subtext::backend::{ActiveBackend, Backend}; use subtext::host_store::HostStore; use subtext::transducer::Reverse; use tokio::signal; #[tokio::main] async fn main() -> Result<(), Box> { let _ = env_logger::try_init(); // Persist file bytes into a fresh temp directory. Held until end of `main` // so the directory survives the daemon's lifetime. let store_dir = tempfile::tempdir()?; println!("Host store directory: {}", store_dir.path().display()); let fs = HostStore::new(store_dir.path(), Reverse)?; let mount_point = tempfile::tempdir()?; let mut opts = MountOptions::default(); opts.mount_point = mount_point.path().to_path_buf(); let backend = ActiveBackend::start(fs, opts).await?; println!("Started: {}. Press Ctrl+C to stop.", backend.describe()); signal::ctrl_c().await?; drop(backend); println!("Stopped."); Ok(()) }