pub struct AntiCollisionParentDir {
parent_dir_path: PathBuf,
child_name_pattern: NamePattern,
next_child_num: AtomicU64,
}Expand description
A filesystem directory that formats unique child paths, formatted using strictly increasing integers.
parent_dir/
<prefix>000...001<suffix>
<prefix>000...002<suffix>
...
<prefix>fff...fff<suffix>
Fields§
§parent_dir_path: PathBuf§child_name_pattern: NamePattern§next_child_num: AtomicU64Implementations§
source§impl AntiCollisionParentDir
impl AntiCollisionParentDir
pub fn load_or_new<P: AsRef<Path>>( parent_dir_path: P, child_name_pattern: NamePattern, handle_child_path: impl FnMut(PathBuf, Result<PathNameNum>) -> Result<()> ) -> Result<Self>
pub fn parent_dir_path(&self) -> &PathBuf
pub fn format_new_child_path(&self) -> PathBuf
Auto Trait Implementations§
impl RefUnwindSafe for AntiCollisionParentDir
impl Send for AntiCollisionParentDir
impl Sync for AntiCollisionParentDir
impl Unpin for AntiCollisionParentDir
impl UnwindSafe for AntiCollisionParentDir
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