Skip to main content

Module Utilities

Module Utilities 

Source
Expand description

Utilities for Wind handlers - one pub fn Fn per atomic file. Shared-state modules (ApplicationRoot, LocalhostUrl, UserdataDir, RecentlyOpened) are directory modules; #[path] overrides are required because the old .rs files still exist in the same directory.

Modules§

ApplicationRoot
/Static/Application/ → Sky Target real path. State held here; Get and Set expose atomic accessors.
ChannelPriority
Maps a wire command string → Echo scheduler lane via the Common Channel registry’s Priority() accessor. Unknown commands fall back to Priority::Normal so unclassified callers don’t starve the high-priority queue.
FiddeeRoot
$HOME/.fiddee - the user-scope dotfile root. Holds VS Code-style extensions (~/.fiddee/extensions), recently-opened workspaces (~/.fiddee/workspaces/RecentlyOpened.json), per-extension storage (~/.fiddee/extensionStorage, ~/.fiddee/globalStorage), and the background-daemon log/data trees (~/.fiddee/logs, ~/.fiddee/data).
JsonValueHelpers
Serde-Value helpers shared across Wind handlers. v_str extracts a string from either a raw JSON string or a VS Code UriComponents object (external / path field). Any new cross-cutting coercer that accepts both shapes belongs here.
LocalhostUrl
The localhost plugin base URL (http://localhost:<port>). State held here; Get and Set expose atomic accessors.
MetadataEncoding
Converts std::fs::Metadata to VS Code’s IStat wire shape. The FileType bits are VS Code’s enum (File=1, Directory=2, SymbolicLink=64); the readdir atoms also emit these values.
PathExtraction
Converts VS Code Uri-shaped arguments to platform-native paths. Co-locates percent-decoding, userdata remapping, and /Static/Application rewriting because each is a private helper of extract_path_from_arg. Percent-decoding is also re-exported for callers outside the VFS path (configuration loaders, etc.).
RecentlyOpened
Recently-opened workspaces/files persistence.
UserdataDir
Canonical userdata base directory (Tauri app_data_dir) + first-access scaffolding. State held here; atomics expose Get/Set/Ensure.