Skip to main content

fslite_core/
lib.rs

1//! Stable, transport-independent filesystem domain primitives.
2//!
3//! This crate defines the canonical [`FileSystem`] trait and the domain
4//! types every implementation shares: absolute, normalized [`VirtualPath`]s,
5//! strongly typed identifiers and revisions, stable machine-readable
6//! [`ErrorCode`]s, and the request/response shapes for every operation. It
7//! contains no SQL, no HTTP, and no host filesystem paths — see the
8//! `fslite-sqlite` crate for a persistent, embeddable implementation.
9//!
10//! ```
11//! use fslite_core::VirtualPath;
12//!
13//! let path = VirtualPath::parse("/a/../a/b")?;
14//! assert_eq!(path.as_str(), "/a/b");
15//! # Ok::<(), fslite_core::FsError>(())
16//! ```
17
18mod error;
19mod fs;
20mod model;
21mod options;
22mod path;
23
24pub use error::{ErrorCode, FsError, FsResult};
25pub use fs::{
26    BatchOperation, BatchResult, ByteStream, Capability, Change, ChangeCursor, ChangeKind,
27    FileRead, FileSystem, Page, RequestContext, SearchMatch, TrashEntry, TrashId, TreeEntry,
28    WorkspaceUsage, WriteSource,
29};
30pub use model::{Node, NodeId, NodeKind, Revision, WorkspaceId};
31pub use options::{
32    ByteRange, ContentQuery, CopyOptions, CreateOptions, DEFAULT_PAGE_LIMIT, FindQuery,
33    MoveOptions, MutationOptions, PageRequest, ReadOptions, RemoveOptions, StatOptions,
34    TouchOptions, TreeOptions, WriteOptions,
35};
36pub use path::{LinkTarget, VirtualPath};