pub struct LocalFile { /* private fields */ }Implementations§
Source§impl LocalFile
impl LocalFile
Sourcepub async fn open(
path: impl AsRef<Path>,
create: bool,
write: bool,
read: bool,
) -> Result<Self>
pub async fn open( path: impl AsRef<Path>, create: bool, write: bool, read: bool, ) -> Result<Self>
Opens up a file at path. Will create the file if `create is true,
otherwise will fail if missing.
- Read permission is set by
read. - Write permission is set by
write.
Internally, the path will be canonicalized to a resolved, absolute path that can be used as reference when examining the local file.
pub fn id(&self) -> u32
pub fn sig(&self) -> u32
pub fn handle(&self) -> LocalFileHandle
pub fn permissions(&self) -> LocalFilePermissions
pub fn path(&self) -> &Path
Sourcepub async fn rename(
&mut self,
sig: u32,
to: impl AsRef<Path>,
) -> Result<u32, LocalFileError>
pub async fn rename( &mut self, sig: u32, to: impl AsRef<Path>, ) -> Result<u32, LocalFileError>
Renames a file (if possible) using its underlying path as the origin
Sourcepub async fn remove(&mut self, sig: u32) -> Result<(), LocalFileError>
pub async fn remove(&mut self, sig: u32) -> Result<(), LocalFileError>
Removes the file (if possible) using its underlying path
NOTE: If successful, this makes the local file reference no longer usable for the majority of its functionality
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LocalFile
impl !RefUnwindSafe for LocalFile
impl Send for LocalFile
impl Sync for LocalFile
impl Unpin for LocalFile
impl UnsafeUnpin for LocalFile
impl !UnwindSafe for LocalFile
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