Something went wrong. Try again.
A user-space CRDT filesystem
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647//! Socket-only session for local development.//!//! [`DevSession`] is a parallel entry point to [`super::session::Session`] that//! starts the same TCP server (same protocol, same `Handler`) but skips//! PlugInKit / `Info.plist` discovery and the `mount(8)` orchestration done by//! [`super::mounter::Mounter`]. This lets a `Filesystem` impl be exercised over//! the wire (e.g. with a separate FSKitBridge / test client) without requiring//! a registered FSKit appex on the host.//!//! Added in subtext's vendored copy; not part of upstream `fskit-rs 0.2.0`.
use super::Filesystem;use super::handler::Handler;use super::socket::{self, Socket};
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug)]pub struct DevSession { socket: Socket,}
impl DevSession { pub async fn new<FS>(fs: FS, server_port: u16) -> Result<Self> where FS: Filesystem + Send + Sync + Clone + 'static, { let handler = Handler::new(fs); let socket = Socket::start(handler, server_port).await?; Ok(Self { socket }) }}
impl Drop for DevSession { fn drop(&mut self) { futures::executor::block_on(async { self.socket.stop().await; }); }}
#[derive(thiserror::Error, Debug)]pub enum Error { #[error(transparent)] Socket(#[from] socket::Error),}