[−][src]Struct over_there_core::FileSystemManager
Methods
impl FileSystemManager
[src]
pub fn new() -> Self
[src]
pub async fn create_dir<'_>(
&'_ self,
path: impl AsRef<Path>,
create_components: bool
) -> Result<()>
[src]
&'_ self,
path: impl AsRef<Path>,
create_components: bool
) -> Result<()>
Creates a new directory
pub async fn rename_dir<'_>(
&'_ mut self,
from: impl AsRef<Path>,
to: impl AsRef<Path>
) -> Result<()>
[src]
&'_ mut self,
from: impl AsRef<Path>,
to: impl AsRef<Path>
) -> Result<()>
Attempts to rename an entire directory.
Will fail if there is an open file within the directory on any level.
pub async fn remove_dir<'_>(
&'_ mut self,
path: impl AsRef<Path>,
non_empty: bool
) -> Result<()>
[src]
&'_ mut self,
path: impl AsRef<Path>,
non_empty: bool
) -> Result<()>
Attempts to remove an entire directory, failing if any file is currently open within the directory.
pub async fn dir_entries<'_>(
&'_ self,
path: impl AsRef<Path>
) -> Result<Vec<LocalDirEntry>>
[src]
&'_ self,
path: impl AsRef<Path>
) -> Result<Vec<LocalDirEntry>>
Retrieves all entries within the directory path
.
This is a non-recursive operation, meaning that it will only yield the immediate directory entires and not walk through subdirectories or follow symlinks.
Will yield an error if there are complications with reading the directory and its entries.
pub async fn open_file<'_>(
&'_ mut self,
path: impl AsRef<Path>,
create: bool,
write: bool,
read: bool
) -> Result<LocalFileHandle>
[src]
&'_ mut self,
path: impl AsRef<Path>,
create: bool,
write: bool,
read: bool
) -> Result<LocalFileHandle>
Opens a file, creating it if create
true, using write
and read
for permissions.
If the file is already open, will return the existing instance. If permissions differ where the returned file does not have read/write access and the request asks for it, the current instance of the file will be closed and a new instance with the same id will be opened with the new permissions where existing and requested permissions align.
pub fn close_file(&mut self, handle: LocalFileHandle) -> Result<LocalFile>
[src]
Closes an open file by handle
.
Will fail if no file with handle
id is open, or if the signature
on the file is different than that of handle
.
pub async fn rename_file<'_>(
&'_ mut self,
from: impl AsRef<Path>,
to: impl AsRef<Path>
) -> Result<()>
[src]
&'_ mut self,
from: impl AsRef<Path>,
to: impl AsRef<Path>
) -> Result<()>
Attempts to rename a file at from
into to
.
Will fail if file is open at from
.
pub async fn remove_file<'_>(&'_ mut self, path: impl AsRef<Path>) -> Result<()>
[src]
Attempts to remove a file, failing if the file is currently open.
pub fn file_cnt(&self) -> usize
[src]
Represents the total files that are open within the manager
pub fn get_mut(&mut self, id: impl Into<u32>) -> Option<&mut LocalFile>
[src]
Looks up an open file by its associated id
pub fn get(&self, id: impl Into<u32>) -> Option<&LocalFile>
[src]
Looks up an open file by its associated id
pub fn exists(&self, id: impl Into<u32>) -> bool
[src]
Determines if a file is open with the specified id
Trait Implementations
impl Debug for FileSystemManager
[src]
impl Default for FileSystemManager
[src]
Auto Trait Implementations
impl !RefUnwindSafe for FileSystemManager
impl Send for FileSystemManager
impl Sync for FileSystemManager
impl Unpin for FileSystemManager
impl !UnwindSafe for FileSystemManager
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,