Struct xvc_walker::sync::PathSync
source · pub struct PathSync { /* private fields */ }Expand description
When multiple threads try to access the same path (especially in cache operations) we get weird race conditions, This structure is to make those operations atomic and thread safe.
Implementations§
source§impl PathSync
impl PathSync
sourcepub fn with_sync_path(
&self,
path: &Path,
f: impl FnMut(&Path) -> Result<()>
) -> Result<()>
pub fn with_sync_path( &self, path: &Path, f: impl FnMut(&Path) -> Result<()> ) -> Result<()>
Locks the path and runs the given closure with it.
sourcepub fn with_sync_abs_path(
&self,
path: &AbsolutePath,
f: impl FnMut(&AbsolutePath) -> Result<()>
) -> Result<()>
pub fn with_sync_abs_path( &self, path: &AbsolutePath, f: impl FnMut(&AbsolutePath) -> Result<()> ) -> Result<()>
Locks the path and runs the given closure with it.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for PathSync
impl Send for PathSync
impl Sync for PathSync
impl Unpin for PathSync
impl UnwindSafe for PathSync
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