Expand description
Cross-platform access to a user-chosen writable folder.
This is the write-side complement of crate::file_picker: where the picker
reads files 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, mirroring the picker:
pick_writable_folder— asynchronous, UI-thread. Presents the system folder picker with a persistent read/write grant and resolves to an opaque, durable handle string the app stores.open_writable_folder— synchronous and thread-safe. Rebuilds aWritableFolderStorefrom a stored handle. Its I/O methods are synchronous andSend + Sync, so a background worker can call them without touching the UI thread.
Read-only or unreachable folders surface as FolderError::ReadOnly /
FolderError::Io so callers can degrade gracefully. iOS (security-scoped
bookmarks) and the web are not supported yet and return
FolderError::Unsupported.
Enums§
- Folder
Error - Errors produced by writable-folder I/O.
Traits§
- Writable
Folder Picker - Presents the system “pick a writable folder” UI. Platform-provided (Android); desktop/web use the built-in backend.
- Writable
Folder Store - Synchronous, thread-safe access to a user-chosen writable folder.
Functions§
- clear_
platform_ writable_ folder_ picker - Removes any registered platform picker (tests/teardown).
- 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. - pick_
writable_ folder - Presents the writable-folder picker and resolves to a durable handle (or
Noneif cancelled). Async; drive it fromLaunchedEffectAsync. - set_
platform_ writable_ folder_ picker - Registers the platform writable-folder picker (Android SAF). The cranpose crate’s backend calls this during startup; once registered it takes precedence over the built-in desktop picker.
- set_
writable_ folder_ store_ factory - Registers the platform store factory (Android). Called once at startup. No-op if already set.
Type Aliases§
- Writable
Folder Picker Ref - Shared handle to a
WritableFolderPicker. - Writable
Folder Store Ref - Shared handle to a
WritableFolderStore.