A Rust companion to FSKitBridge that provides the protocol & socket layer and a trait for implementing your macOS FSKit backend in Rust.
Requires macOS 15.4+
FSKit runs file systems in user space on macOS, but its public API is Swift. fskit-rs lets you keep the engine
in Rust while FSKitBridge (Swift/appex) handles FSKit/XPC. The two talk over TCP localhost using length-delimited
Protobuf messages defined in protocol.proto.
Keep your core in Rust; let FSKitBridge speak Swift to macOS.
This crate pairs with the Swift-side FSKitBridge project (host app + FSKitExt appex). For the Swift/FSKit integration details, see:
- Trait-based backend API: Implement the
Filesystemtrait to handle file system operations. - Types & schema (
protocol.proto): Common FS/OS types re-exported from code generated by the protocol schema. The schema is the wire contract between the Swift appex and this Rust backend — defining all RPC messages/enums. - Handle errors: Unified
Error(includes POSIX vialibc::*) andResult<T>. - Session runner:
session::mount(fs, opts)mounts and serves requests until dropped. - Installer helper:
install(path, force)utility for host app installation (optional).
This crate is the transport + protocol + trait layer. You bring the actual file system logic.
A minimal example is provided in examples/basic_fs.rs. It starts a stub backend with default MountOptions, mounts
the file system (e.g., at /tmp/fskitbridge), and serves requests until you press Ctrl+C. Use it as a skeleton and
replace the ENOSYS stubs with your real logic.
This project is dual-licensed under Apache-2.0 and MIT:
- Apache License, Version 2.0 —
LICENSE-APACHE - MIT License —
LICENSE-MIT
Contributions: Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work shall be dual-licensed as above, without additional terms or conditions.