-
Notifications
You must be signed in to change notification settings - Fork 798
chore: Clarify FS Plugin Rust Side Exposure #2590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,14 @@ Install the fs plugin to get started. | |
|
||
The fs plugin is available in both JavaScript and Rust. | ||
|
||
:::note[Rust Exposure] | ||
|
||
The exposed API on the Rust side is mostly intended to manipulate the [Scope](#scopes) of the plugin. | ||
It does expose some APIs to access the file system on mobile, but the recommendation is to use [`tokio::fs`](https://docs.rs/tokio/latest/tokio/fs/index.html) or the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For Android the tokio or std APIs won't work if you're using e.g. the dialog API (which returns a content:// URI instead of a path to the file). We might also need more changes for iOS to properly request for permissions to access some files (for instance photos, or the Files location). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. :flip-table: 😂 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we'll fallback to std for desktop, so if you need cross platform support for e.g. reading resources and dialog-selected files, you need to use our own API wrapper There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so I think we should skip this note and also document the Rust API instead |
||
[`std::fs`](https://doc.rust-lang.org/std/fs/index.html) for accessing the file system. | ||
|
||
::: | ||
|
||
<Tabs> | ||
<TabItem label="JavaScript" > | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.