Trait tc_transact::fs::DirWrite
source · [−]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
Required Methods
sourcefn create_dir(&mut self, name: PathSegment) -> TCResult<Self::Lock>
fn create_dir(&mut self, name: PathSegment) -> TCResult<Self::Lock>
Create a new Dir
.
sourcefn create_dir_unique(&mut self) -> TCResult<Self::Lock>
fn create_dir_unique(&mut self) -> TCResult<Self::Lock>
Create a new Dir
with a new unique ID.
Create a new File
.
Provided Methods
sourcefn get_or_create_dir(&mut self, name: PathSegment) -> TCResult<Self::Lock>
fn get_or_create_dir(&mut self, name: PathSegment) -> TCResult<Self::Lock>
Get the Dir
with the given name
and create a new one if none exists.