Skip to content

Commit a33a62a

Browse files
committed
chore: add inline doc that this must be run in a web worker
1 parent d1fa6ca commit a33a62a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ type IoResult<T> = std::io::Result<T>;
2626

2727
/// Implementataion of a [`StorageBackend`] which delegates to [OPFS] when built for wasm.
2828
///
29+
/// **IMPORTANT**: This can only ever be used within a web worker.
30+
/// This _may_ instantiate within the main thread, but as it blocks internally,
31+
/// it will fail at runtime on the main thread if you attempt to actually use it.
32+
///
2933
/// In native contexts, this targets the local file system.
3034
///
3135
/// [OPFS]: https://developer.mozilla.org/en-US/docs/Web/API/File_System_API/Origin_private_file_system

0 commit comments

Comments
 (0)