Something went wrong. Try again.
A user-space CRDT filesystem
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344//! Filesystem backend abstraction.//!//! At compile time the active backend is selected by Cargo feature://! - default → [`prod::ProdBackend`] (real FSKit mount via [`fskit_rs::mount`]).//! - `dev` → [`dev::DevBackend`] (socket-only, no FSKit / no `mount(8)`).//!//! Both expose the same shape via the [`Backend`] trait, so [`crate::main`]//! and any caller can be feature-agnostic.
use async_trait::async_trait;use fskit_rs::{Filesystem, MountOptions};
pub type Result<T> = std::result::Result<T, Error>;
#[async_trait]pub trait Backend: Send + Sync + Sized + 'static { /// Start the backend; returns once it's ready to accept requests. async fn start<FS>(fs: FS, opts: MountOptions) -> Result<Self> where FS: Filesystem + Send + Sync + Clone + 'static;
/// Short, user-facing description (mount point, socket address, ...). fn describe(&self) -> String;}
#[cfg(not(feature = "dev"))]mod prod;#[cfg(not(feature = "dev"))]pub use prod::ProdBackend as ActiveBackend;
#[cfg(feature = "dev")]mod dev;#[cfg(feature = "dev")]pub use dev::DevBackend as ActiveBackend;
#[derive(thiserror::Error, Debug)]pub enum Error { #[error(transparent)] Session(#[from] fskit_rs::session::Error),
#[error(transparent)] DevSession(#[from] fskit_rs::dev_session::Error),}