Enum tauri_plugin_fs::SafeFilePath 
source · pub enum SafeFilePath {
    Url(Url),
    Path(SafePathBuf),
}Expand description
Represents either a safe filesystem path or a URI pointing to a file
such as file:// URIs or Android content:// URIs.
Variants§
Url(Url)
file:// URIs or Android content:// URIs.
Path(SafePathBuf)
Safe PathBuf, see `SafePathBuf``.
Implementations§
source§impl SafeFilePath
 
impl SafeFilePath
sourcepub fn as_path(&self) -> Option<&Path>
 
pub fn as_path(&self) -> Option<&Path>
Get a reference to the contaiend Path if the variant is SafeFilePath::Path.
Use SafeFilePath::into_path to try to convert the SafeFilePath::Url variant as well.
sourcepub fn into_path(self) -> Result<PathBuf, Error>
 
pub fn into_path(self) -> Result<PathBuf, Error>
Try to convert into PathBuf if possible.
This calls Url::to_file_path if the variant is SafeFilePath::Url,
otherwise returns the contained PathBuf as is.
sourcepub fn simplified(self) -> Self
 
pub fn simplified(self) -> Self
Takes the contained PathBuf if the variant is SafeFilePath::Path,
and when possible, converts Windows UNC paths to regular paths.
Trait Implementations§
source§impl Clone for SafeFilePath
 
impl Clone for SafeFilePath
source§fn clone(&self) -> SafeFilePath
 
fn clone(&self) -> SafeFilePath
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moresource§impl Debug for SafeFilePath
 
impl Debug for SafeFilePath
source§impl<'de> Deserialize<'de> for SafeFilePath
 
impl<'de> Deserialize<'de> for SafeFilePath
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
source§impl Display for SafeFilePath
 
impl Display for SafeFilePath
source§impl From<SafeFilePath> for FilePath
 
impl From<SafeFilePath> for FilePath
source§fn from(value: SafeFilePath) -> Self
 
fn from(value: SafeFilePath) -> Self
Converts to this type from the input type.
source§impl From<Url> for SafeFilePath
 
impl From<Url> for SafeFilePath
source§impl FromStr for SafeFilePath
 
impl FromStr for SafeFilePath
source§impl Serialize for SafeFilePath
 
impl Serialize for SafeFilePath
source§impl TryFrom<&Path> for SafeFilePath
 
impl TryFrom<&Path> for SafeFilePath
source§impl TryFrom<&PathBuf> for SafeFilePath
 
impl TryFrom<&PathBuf> for SafeFilePath
source§impl TryFrom<FilePath> for SafeFilePath
 
impl TryFrom<FilePath> for SafeFilePath
source§impl TryFrom<PathBuf> for SafeFilePath
 
impl TryFrom<PathBuf> for SafeFilePath
Auto Trait Implementations§
impl Freeze for SafeFilePath
impl RefUnwindSafe for SafeFilePath
impl Send for SafeFilePath
impl Sync for SafeFilePath
impl Unpin for SafeFilePath
impl UnwindSafe for SafeFilePath
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
source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
 
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)