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<(), Error>,
) -> Result<(), Error>
pub fn with_sync_path( &self, path: &Path, f: impl FnMut(&Path) -> Result<(), Error>, ) -> Result<(), Error>
Locks the path and runs the given closure with it.
Sourcepub fn with_sync_abs_path(
&self,
path: &AbsolutePath,
f: impl FnMut(&AbsolutePath) -> Result<(), Error>,
) -> Result<(), Error>
pub fn with_sync_abs_path( &self, path: &AbsolutePath, f: impl FnMut(&AbsolutePath) -> Result<(), Error>, ) -> Result<(), Error>
Locks the path and runs the given closure with it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PathSync
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
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more