pub trait DirWrite: DirRead {
    type FileClass: Copy + Send + Display;

    fn create_dir(&mut self, name: PathSegment) -> TCResult<Self::Lock>;
    fn create_dir_unique(&mut self) -> TCResult<Self::Lock>;
    fn create_file<C, F, B>(&mut self, name: Id, class: C) -> TCResult<F>
   where
        Self::FileClass: From<C>,
        Self::FileEntry: AsType<F>,
        C: Copy + Send + Display,
        B: BlockData,
        F: File<B>
; fn create_file_unique<C, F, B>(&mut self, class: C) -> TCResult<F>
   where
        Self::FileClass: From<C>,
        Self::FileEntry: AsType<F>,
        C: Copy + Send + Display,
        B: BlockData,
        F: File<B>
; fn get_or_create_dir(&mut self, name: PathSegment) -> TCResult<Self::Lock> { ... } fn get_or_create_file<C, F, B>(
        &mut self,
        name: PathSegment,
        class: C
    ) -> TCResult<F>
   where
        Self::FileClass: From<C>,
        Self::FileEntry: AsType<F>,
        C: Copy + Send + Display,
        B: BlockData,
        F: File<B>
, { ... } }
Expand description

A write lock on a Dir

Required Associated Types

The Class of a file stored in this Dir

Required Methods

Create a new Dir.

Create a new Dir with a new unique ID.

Create a new File.

Create a new File with a new unique ID.

Provided Methods

Get the Dir with the given name and create a new one if none exists.

Get the File with the given name and create a new one if none exists.

Implementors