Skip to main content

Crate musefs_core

Crate musefs_core 

Source

Modules§

convert
Sanctioned integer conversions, justified by the 64-bit-only guard below.
freshness
The backing-file freshness stamp: the identity a tracks row records for its backing file, compared on every serve to detect an on-disk change that no database write covers. Strengthened past size + whole-second mtime to nanosecond mtime + ctime (#276) so a same-size in-place rewrite — including an adversarial one that resets mtime — cannot evade the guard.
metrics
Optional syscall/query counters and per-syscall latency injection for benchmarking. Zero-cost when the metrics feature is off: every hook compiles to an empty inline fn, so call sites stay unconditional and clean.

Structs§

Attr
Attributes the FUSE layer maps onto fuser::FileAttr.
Fh
A FUSE file handle: the sharded-slab key offset by one, so the wire value is never 0 (0 on the wire means “no handle” — read falls back to inode resolution).
HeaderCache
A per-mount cache of resolved files keyed by track id; an entry self-invalidates when the track’s content_version changes. Backed by quick_cache: S3-FIFO eviction, byte-weighted, internally sharded.
MountConfig
Per-mount configuration for rendering the virtual hierarchy.
Musefs
The composed read-only filesystem: the store, the rendered tree, and the lazy synthesis cache. All methods take &self; the tree is swapped atomically on refresh, the cache is internally sharded (each shard mutex-guarded), and the data-version stamp is atomic. This makes Musefs Sync, so the FUSE layer can later share it across a worker pool.
Node
PassthroughFd
An owned view of an open handle’s backing fd, for FUSE passthrough registration. Holds its own Arc<Handle>, so the fd outlives a concurrent slab removal while the registration ioctl is in flight.
ResolvedFile
A fully resolved synthesized file: its segment layout, total size, the content version it was built from, and where the backing audio lives.
RevalidateStats
ScanOptions
Knobs for a scan. jobs == 0 means “use available parallelism”.
ScanStats
Template
A parsed path template: literal runs, $field / ${field} substitutions (with optional ${a|b} fallback chains and $!{field} slash-preserving path fields), and [...] conditional sections. Parse once per mount; render then costs one output String per call, with no re-parse.
VirtualTree
An in-memory virtual filesystem tree: directories derived from path components and files mapped to track ids. Inodes are stable for the lifetime of the tree.

Enums§

CoreError
DbPool
with and with_poll may nest freely, on any variant: PerThread reads hand out cloned Arcs from the pool-owned map, and the connection locks are reentrant.
Mode
How the mount serves file contents. The virtual tree is identical either way.
NodeKind
TemplateError
Why a template was rejected at parse time. Surfaced to the operator via crate::CoreError::InvalidTemplate when Musefs::open parses a bad --template.

Functions§

read_at
Allocating form of read_at_into (tests and non-hot-path callers).
read_at_with_file
Allocating form of read_at_with_file_into.
revalidate
Back-compat shim used by the CLI and existing tests.
revalidate_with
Re-validate an already-scanned library root: re-probe only files whose size/mtime/ctime changed since the last scan (skipping unchanged ones so external tag edits in the DB are preserved), then delete tracks under root whose backing file is gone (cascading tags/art links) and garbage-collect now-unreferenced art. root may be a single audio file (only that file is revalidated) or a directory (walked recursively). Pruning is scoped to root, so revalidating one library root never removes tracks belonging to another.
scan_directory
Back-compat shim used by the CLI and existing tests.
scan_directory_with
Public entry: parallel-probe / single-writer scan of root.

Type Aliases§

Result