Skip to main content

Module writable_folder

Module writable_folder 

Source
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:

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§

FolderEntry
Display metadata for one file in a writable folder.

Enums§

FolderError
Errors produced by writable-folder I/O.

Traits§

FolderReader
Chunked reader over one file in a writable folder.
FolderWriter
Chunked writer over one file in a writable folder.
WritableFolderStore
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 None only 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§

WritableFolderStoreRef
Shared handle to a WritableFolderStore.