pub struct Path { /* private fields */ }
Implementations§
Source§impl Path
impl Path
pub fn new(path: impl AsRef<StdPath>) -> Self
pub fn absolutize(&self) -> Result<Self>
pub fn absolutize_from(&self, cwd: impl AsRef<StdPath>) -> Result<Self>
pub fn absolutize_virtually( &self, virtual_root: impl AsRef<StdPath>, ) -> Result<Self>
pub fn canonicalize(&self) -> Result<Self, Error>
pub fn extension(&self) -> Option<&OsStr>
pub fn file_name(&self) -> Option<&OsStr>
pub fn file_stem(&self) -> Option<&OsStr>
pub fn is_absolute(&self) -> bool
pub fn join(&self, path: impl AsRef<StdPath>) -> Self
pub fn parent(&self) -> Option<Self>
pub fn to_str(&self) -> Option<&str>
pub fn to_string_lossy(&self) -> Cow<'_, str>
Trait Implementations§
Source§impl AsyncFsOps for Path
impl AsyncFsOps for Path
fn chmod<'life0, 'async_trait>(
&'life0 self,
mode: u32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn chown<'life0, 'async_trait>(
&'life0 self,
uid: Option<u32>,
gid: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_dir<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_dir_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn empty_dir<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn exists<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_file_size<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_block_device<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_char_device<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_dir<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_fifo<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_file<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_socket<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_symlink<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn metadata<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Metadata>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_dir<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ReadDir>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_json<'life0, 'async_trait, T>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned,
Self: 'async_trait,
'life0: 'async_trait,
fn read_to_string<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove_dir<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove_dir_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_permissions<'life0, 'async_trait>(
&'life0 self,
permissions: Permissions,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn truncate<'life0, 'async_trait>(
&'life0 self,
len: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn write<'life0, 'async_trait>(
&'life0 self,
contents: impl 'async_trait + AsRef<[u8]> + Send,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn write_json<'life0, 'async_trait>(
&'life0 self,
data: impl 'async_trait + Serialize + Send,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl SyncFsOps for Path
impl SyncFsOps for Path
fn chmod_sync(&self, mode: u32) -> Result<()>
fn chown_sync(&self, uid: Option<u32>, gid: Option<u32>) -> Result<()>
fn create_dir_all_sync(&self) -> Result<()>
fn create_dir_sync(&self) -> Result<()>
fn empty_dir_sync(&self) -> Result<()>
fn exists_sync(&self) -> Result<bool>
fn get_file_size_sync(&self) -> Result<u64>
fn is_block_device_sync(&self) -> Result<bool>
fn is_char_device_sync(&self) -> Result<bool>
fn is_dir_sync(&self) -> Result<bool>
fn is_fifo_sync(&self) -> Result<bool>
fn is_file_sync(&self) -> Result<bool>
fn is_socket_sync(&self) -> Result<bool>
fn is_symlink_sync(&self) -> Result<bool>
fn metadata_sync(&self) -> Result<Metadata>
fn read_sync(&self) -> Result<Vec<u8>>
fn read_dir_sync(&self) -> Result<ReadDir>
fn read_json_sync<T: DeserializeOwned>(&self) -> Result<T>
fn read_to_string_sync(&self) -> Result<String>
fn remove_dir_all_sync(&self) -> Result<()>
fn remove_dir_sync(&self) -> Result<()>
fn set_permissions_sync(&self, permissions: Permissions) -> Result<()>
fn truncate_sync(&self, len: Option<u64>) -> Result<()>
fn write_sync(&self, contents: impl AsRef<[u8]>) -> Result<()>
fn write_json_sync(&self, data: impl Serialize) -> Result<()>
impl Eq for Path
Auto Trait Implementations§
impl Freeze for Path
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnwindSafe for Path
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