pub struct LocalDirectory { /* private fields */ }
Expand description
A convenience wrapper over a local directory.
Implementations§
Source§impl LocalDirectory
impl LocalDirectory
Trait Implementations§
Source§impl Debug for LocalDirectory
impl Debug for LocalDirectory
Source§impl Directory for LocalDirectory
impl Directory for LocalDirectory
Source§fn open_dir_readonly<P: AsRef<Path> + Send>(
&self,
relative_path: P,
) -> Result<Self>
fn open_dir_readonly<P: AsRef<Path> + Send>( &self, relative_path: P, ) -> Result<Self>
Attempts to open the directory at
relative_path
with read-only rights.Source§fn open_dir_readwrite<P: AsRef<Path> + Send>(
&self,
relative_path: P,
) -> Result<Self>
fn open_dir_readwrite<P: AsRef<Path> + Send>( &self, relative_path: P, ) -> Result<Self>
Attempts to open the directory at
relative_path
with read/write rights.Source§fn create_dir<P: AsRef<Path> + Send>(
&self,
relative_path: P,
_readwrite: bool,
) -> Result<Self>
fn create_dir<P: AsRef<Path> + Send>( &self, relative_path: P, _readwrite: bool, ) -> Result<Self>
Attempts to create a directory at
relative_path
with read right (if readwrite
is false) or read/write rights (if readwrite
is true).Source§fn read_file<'life0, 'async_trait, P>(
&'life0 self,
relative_path: P,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
fn read_file<'life0, 'async_trait, P>( &'life0 self, relative_path: P, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
Returns the contents of the file at
relative_path
as a string.Source§fn read_file_bytes<'life0, 'async_trait, P>(
&'life0 self,
relative_path: P,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
fn read_file_bytes<'life0, 'async_trait, P>( &'life0 self, relative_path: P, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
Returns the contents of the file at
relative_path
as bytes.Source§fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
filename: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
filename: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns true if an entry called
filename
exists in this directory. filename
must be
a plain file name, not a relative path.Source§fn entry_type<'life0, 'life1, 'async_trait>(
&'life0 self,
filename: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<DirentKind>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn entry_type<'life0, 'life1, 'async_trait>(
&'life0 self,
filename: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<DirentKind>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns the type of entry specified by
filename
, or None if no entry by that name
is found. filename
must be a plan file name, not a relative path.Source§fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
relative_path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
relative_path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes the file at
relative_path
.Source§fn write_file<'life0, 'life1, 'async_trait, P>(
&'life0 self,
relative_path: P,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn write_file<'life0, 'life1, 'async_trait, P>( &'life0 self, relative_path: P, data: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Writes
data
to a file at relative_path
. Overwrites if the file already
exists.Auto Trait Implementations§
impl Freeze for LocalDirectory
impl RefUnwindSafe for LocalDirectory
impl Send for LocalDirectory
impl Sync for LocalDirectory
impl Unpin for LocalDirectory
impl UnwindSafe for LocalDirectory
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