pub struct FileUri { /* private fields */ }Expand description
Path to represent a file or directory.
§Note
For compatibility, an interconversion to tauri_plugin_fs::FilePath is implemented, such as follwing.
This is lossy and also not guaranteed to work properly with other plugins.
However, reading and writing files by official tauri_plugin_fs etc. should work well.
ⓘ
use tauri_plugin_android_fs::FileUri;
use tauri_plugin_fs::FilePath;
let uri: FileUri = unimplemented!();
let path: FilePath = uri.into();
let uri: FileUri = path.into();§Typescript type
type FileUri = {
uri: string, // This can use as path for official tauri_plugin_fs
documentTopTreeUri: string | null
}Implementations§
Source§impl FileUri
impl FileUri
pub fn to_json_string(&self) -> Result<String>
pub fn from_json_str(json: impl AsRef<str>) -> Result<Self>
Sourcepub fn from_path(path: impl AsRef<Path>) -> Self
pub fn from_path(path: impl AsRef<Path>) -> Self
Constructs a URI from the absolute path of a file or directory.
Even if the path is invalid, it will not cause an error or panic; an invalid URI will be returned.
§Note
There are a few points to note regarding this.
- This URI cannot be passed to functions of
FileOpener. - Operations using this URI may fall back to
std::fsinstead of Kotlin API.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FileUri
impl<'de> Deserialize<'de> for FileUri
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for FileUri
impl StructuralPartialEq for FileUri
Auto Trait Implementations§
impl Freeze for FileUri
impl RefUnwindSafe for FileUri
impl Send for FileUri
impl Sync for FileUri
impl Unpin for FileUri
impl UnwindSafe for FileUri
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