pub struct FileSystem {
pub root: Rc<RefCell<Inode>>,
}Expand description
Collection of files.
Fields§
§root: Rc<RefCell<Inode>>Root directory
Implementations§
Source§impl FileSystem
impl FileSystem
Sourcepub fn save<P: AsRef<Path>>(
&mut self,
path: P,
content: Rc<RefCell<Inode>>,
) -> Result<Option<Rc<RefCell<Inode>>>, Errno>
pub fn save<P: AsRef<Path>>( &mut self, path: P, content: Rc<RefCell<Inode>>, ) -> Result<Option<Rc<RefCell<Inode>>>, Errno>
Saves a file.
If there is an existing file at the specified path, this function replaces it the new file and returns the old one, regardless of permissions.
TODO Reject relative path
Trait Implementations§
Source§impl Clone for FileSystem
impl Clone for FileSystem
Source§fn clone(&self) -> FileSystem
fn clone(&self) -> FileSystem
Returns a duplicate 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 FileSystem
impl Debug for FileSystem
Source§impl Default for FileSystem
The default file system only contains an empty root directory.
impl Default for FileSystem
The default file system only contains an empty root directory.
Source§impl PartialEq for FileSystem
impl PartialEq for FileSystem
impl Eq for FileSystem
impl StructuralPartialEq for FileSystem
Auto Trait Implementations§
impl Freeze for FileSystem
impl !RefUnwindSafe for FileSystem
impl !Send for FileSystem
impl !Sync for FileSystem
impl Unpin for FileSystem
impl !UnwindSafe for FileSystem
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more