Expand description
Cross-platform access to a user-chosen writable folder.
This is the write-side complement of crate::file_picker: where the
choosers read content the user selects, this lets an app persist its own
data into a folder the user grants — a local directory on desktop, a Storage
Access Framework tree on Android — and read it back on later runs. The
motivating use is cross-device sync, where each device writes a small
document into a shared folder (e.g. on a Tailnet/WebDAV mount) and reads its
peers’.
Two halves:
crate::launcher::rememberWritableFolderLauncherpresents the system chooser and hands back the opaque, durable handle string the app stores. The launcher owns the request across host recreation.open_writable_folderis synchronous and thread-safe. It rebuilds aWritableFolderStorefrom a stored handle, so a background worker can read and write without touching the UI thread.
Stores expose whole-file operations, FolderEntry display metadata, and
chunked FolderReader/FolderWriter streams for payloads that should
not be buffered. Read-only or unreachable folders surface as
FolderError::ReadOnly / FolderError::Io so callers can degrade
gracefully. Backends: desktop (std::fs), Android (SAF tree URIs), iOS
(security-scoped bookmarks). The web has no writable-folder concept and
returns FolderError::Unsupported.
Structs§
- Folder
Entry - Display metadata for one file in a writable folder.
Enums§
- Folder
Error - Errors produced by writable-folder I/O.
Traits§
- Folder
Reader - Chunked reader over one file in a writable folder.
- Folder
Writer - Chunked writer over one file in a writable folder.
- Writable
Folder Store - Synchronous, thread-safe access to a user-chosen writable folder.
Functions§
- open_
writable_ folder - Reopens a writable folder from a stored handle. Synchronous and callable from
any thread; returns
Noneonly when writable folders are unsupported here. - set_
writable_ folder_ store_ factory - Registers the platform store factory (Android, iOS). Called once at startup. No-op if already set.
Type Aliases§
- Writable
Folder Store Ref - Shared handle to a
WritableFolderStore.