pub struct PrivateStorage<'a, R: Runtime>(/* private fields */);
Expand description
API of file storage intended for the app’s use only.
§Examples
fn example(app: &tauri::AppHandle) {
use tauri_plugin_android_fs::AndroidFsExt as _;
let api = app.android_fs();
let private_storage = api.private_storage();
}
Implementations§
Source§impl<'a, R: Runtime> PrivateStorage<'a, R>
impl<'a, R: Runtime> PrivateStorage<'a, R>
Sourcepub fn resolve_path(&self, dir: PrivateDir) -> Result<PathBuf>
pub fn resolve_path(&self, dir: PrivateDir) -> Result<PathBuf>
Get the absolute path of the specified directory.
App can fully manage entries within this directory.
This function does not create any directories; it only constructs the path.
These entries will be deleted when the app is uninstalled and may also be deleted at the user’s initialising request.
When using PrivateDir::Cache
, the system will automatically delete entries as disk space is needed elsewhere on the device.
Since the returned paths can change when the app is moved to an adopted storage device, only relative paths should be stored.
§Support
All Android version.
pub fn resolve_uri( &self, dir: PrivateDir, relative_path: impl AsRef<Path>, ) -> Result<FileUri>
👎Deprecated: Use FileUri::from_path instead
Auto Trait Implementations§
impl<'a, R> Freeze for PrivateStorage<'a, R>
impl<'a, R> RefUnwindSafe for PrivateStorage<'a, R>
impl<'a, R> Send for PrivateStorage<'a, R>
impl<'a, R> Sync for PrivateStorage<'a, R>
impl<'a, R> Unpin for PrivateStorage<'a, R>
impl<'a, R> UnwindSafe for PrivateStorage<'a, R>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more