Trait tc_transact::fs::DirCreateFile
source · pub trait DirCreateFile<F: File<Inner = <Self::Lock as Dir>::Inner>>: DirRead {
fn create_file(&mut self, name: PathSegment) -> TCResult<F>;
fn create_file_unique(&mut self) -> TCResult<F>;
fn get_or_create_file(&mut self, name: PathSegment) -> TCResult<F>;
}
Expand description
A write lock on a Dir
used to create a file
Required Methods§
sourcefn create_file(&mut self, name: PathSegment) -> TCResult<F>
fn create_file(&mut self, name: PathSegment) -> TCResult<F>
Create a new File
.
sourcefn create_file_unique(&mut self) -> TCResult<F>
fn create_file_unique(&mut self) -> TCResult<F>
Create a new File
with a new unique ID.
sourcefn get_or_create_file(&mut self, name: PathSegment) -> TCResult<F>
fn get_or_create_file(&mut self, name: PathSegment) -> TCResult<F>
Get the File
with the given name
and create a new one if none exists.