pub struct DirGuard<C, L> { /* private fields */ }Expand description
A lock guard for a Dir
Implementations§
source§impl<C, L> DirGuard<C, L>where
    C: Deref<Target = Dir<CacheBlock>> + Send + Sync,
    L: Deref<Target = BTreeMap<PathSegment, DirEntry>> + Send + Sync,
 
impl<C, L> DirGuard<C, L>where
    C: Deref<Target = Dir<CacheBlock>> + Send + Sync,
    L: Deref<Target = BTreeMap<PathSegment, DirEntry>> + Send + Sync,
pub fn file_names(&self) -> impl Iterator<Item = &PathSegment>
pub fn iter(&self) -> impl Iterator<Item = (&PathSegment, &DirEntry)>
source§impl DirGuard<DirReadGuard<CacheBlock>, TxnLockReadGuard<BTreeMap<Id, DirEntry, Global>>>
 
impl DirGuard<DirReadGuard<CacheBlock>, TxnLockReadGuard<BTreeMap<Id, DirEntry, Global>>>
source§impl DirGuard<DirWriteGuard<CacheBlock>, TxnLockWriteGuard<BTreeMap<Id, DirEntry, Global>>>
 
impl DirGuard<DirWriteGuard<CacheBlock>, TxnLockWriteGuard<BTreeMap<Id, DirEntry, Global>>>
sourcepub fn create_store(self, name: PathSegment) -> Store
 
pub fn create_store(self, name: PathSegment) -> Store
sourcepub fn get_or_create_store(self, name: PathSegment) -> Store
 
pub fn get_or_create_store(self, name: PathSegment) -> Store
sourcepub fn create_store_unique(self) -> Store
 
pub fn create_store_unique(self) -> Store
Trait Implementations§
source§impl<C, L> DirCreate for DirGuard<C, L>where
    C: DerefMut<Target = Dir<CacheBlock>> + Send + Sync,
    L: DerefMut<Target = BTreeMap<PathSegment, DirEntry>> + Send + Sync,
 
impl<C, L> DirCreate for DirGuard<C, L>where
    C: DerefMut<Target = Dir<CacheBlock>> + Send + Sync,
    L: DerefMut<Target = BTreeMap<PathSegment, DirEntry>> + Send + Sync,
source§fn create_dir(&mut self, name: PathSegment) -> TCResult<Self::Lock>
 
fn create_dir(&mut self, name: PathSegment) -> TCResult<Self::Lock>
Create a new 
Dir.source§fn 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.source§impl<C, L, K, B> DirCreateFile<File<K, B>> for DirGuard<C, L>where
    C: DerefMut<Target = Dir<CacheBlock>> + Send + Sync,
    L: DerefMut<Target = BTreeMap<PathSegment, DirEntry>> + Send + Sync,
    B: BlockData,
    K: FromStr + Display + Ord + Clone + Send + Sync + 'static,
    <K as FromStr>::Err: Error + Display,
    File<K, B>: FileExt,
    FileEntry: AsType<File<K, B>>,
    CacheBlock: AsType<B>,
 
impl<C, L, K, B> DirCreateFile<File<K, B>> for DirGuard<C, L>where
    C: DerefMut<Target = Dir<CacheBlock>> + Send + Sync,
    L: DerefMut<Target = BTreeMap<PathSegment, DirEntry>> + Send + Sync,
    B: BlockData,
    K: FromStr + Display + Ord + Clone + Send + Sync + 'static,
    <K as FromStr>::Err: Error + Display,
    File<K, B>: FileExt,
    FileEntry: AsType<File<K, B>>,
    CacheBlock: AsType<B>,
source§fn create_file_unique(&mut self) -> TCResult<File<K, B>>
 
fn create_file_unique(&mut self) -> TCResult<File<K, B>>
Create a new 
File with a new unique ID.source§fn get_or_create_file(&mut self, name: PathSegment) -> TCResult<File<K, B>>
 
fn get_or_create_file(&mut self, name: PathSegment) -> TCResult<File<K, B>>
Get the 
File with the given name and create a new one if none exists.source§impl<C, L> DirRead for DirGuard<C, L>where
    C: Deref<Target = Dir<CacheBlock>> + Send + Sync,
    L: Deref<Target = BTreeMap<PathSegment, DirEntry>> + Send + Sync,
 
impl<C, L> DirRead for DirGuard<C, L>where
    C: Deref<Target = Dir<CacheBlock>> + Send + Sync,
    L: Deref<Target = BTreeMap<PathSegment, DirEntry>> + Send + Sync,
source§fn contains(&self, name: &PathSegment) -> bool
 
fn contains(&self, name: &PathSegment) -> bool
Return 
true if this directory has an entry at the given PathSegment.source§impl<C, L, K, B> DirReadFile<File<K, B>> for DirGuard<C, L>where
    K: FromStr + Display + Ord + Clone + Send + Sync + 'static,
    C: Deref<Target = Dir<CacheBlock>> + Send + Sync,
    L: Deref<Target = BTreeMap<PathSegment, DirEntry>> + Send + Sync,
    B: BlockData,
    <K as FromStr>::Err: Error + Display,
    CacheBlock: AsType<B>,
    FileEntry: AsType<File<K, B>>,
 
impl<C, L, K, B> DirReadFile<File<K, B>> for DirGuard<C, L>where
    K: FromStr + Display + Ord + Clone + Send + Sync + 'static,
    C: Deref<Target = Dir<CacheBlock>> + Send + Sync,
    L: Deref<Target = BTreeMap<PathSegment, DirEntry>> + Send + Sync,
    B: BlockData,
    <K as FromStr>::Err: Error + Display,
    CacheBlock: AsType<B>,
    FileEntry: AsType<File<K, B>>,
Auto Trait Implementations§
impl<C, L> RefUnwindSafe for DirGuard<C, L>where
    C: RefUnwindSafe,
    L: RefUnwindSafe,
impl<C, L> Send for DirGuard<C, L>where
    C: Send,
    L: Send,
impl<C, L> Sync for DirGuard<C, L>where
    C: Sync,
    L: Sync,
impl<C, L> Unpin for DirGuard<C, L>where
    C: Unpin,
    L: Unpin,
impl<C, L> UnwindSafe for DirGuard<C, L>where
    C: UnwindSafe,
    L: UnwindSafe,
Blanket Implementations§
source§impl<T> Instrument for T
 
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
 
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
 
fn in_current_span(self) -> Instrumented<Self>
source§impl<F> Match for F
 
impl<F> Match for F
source§fn matches<T>(&self) -> boolwhere
    T: TryCastFrom<Self>,
 
fn matches<T>(&self) -> boolwhere
    T: TryCastFrom<Self>,
Returns 
true if self can be cast into the target type T.source§impl<F, T> TryCastFrom<F> for Twhere
    T: CastFrom<F>,
 
impl<F, T> TryCastFrom<F> for Twhere
    T: CastFrom<F>,
source§fn can_cast_from(_: &F) -> bool
 
fn can_cast_from(_: &F) -> bool
Test if 
value can be cast into Self.source§fn opt_cast_from(f: F) -> Option<T>
 
fn opt_cast_from(f: F) -> Option<T>
Returns 
Some(Self) if the source value can be cast into Self, otherwise None.source§impl<F, T> TryCastInto<T> for Fwhere
    T: TryCastFrom<F>,
 
impl<F, T> TryCastInto<T> for Fwhere
    T: TryCastFrom<F>,
source§fn can_cast_into(&self) -> bool
 
fn can_cast_into(&self) -> bool
Test if 
self can be cast into T.source§fn opt_cast_into(self) -> Option<T>
 
fn opt_cast_into(self) -> Option<T>
Returns 
Some(T) if self can be cast into T, otherwise None.