pub struct DirLock<FE> { /* private fields */ }
Expand description
A clone-able wrapper type over a RwLock
on a directory.
Implementations§
source§impl<FE: Send + Sync> DirLock<FE>
impl<FE: Send + Sync> DirLock<FE>
sourcepub async fn read(&self) -> DirReadGuard<'_, FE>
pub async fn read(&self) -> DirReadGuard<'_, FE>
Lock this directory for reading.
sourcepub async fn into_read(self) -> DirReadGuardOwned<FE>
pub async fn into_read(self) -> DirReadGuardOwned<FE>
Lock this directory for reading, without borrowing.
sourcepub fn try_read(&self) -> Result<DirReadGuard<'_, FE>, Error>
pub fn try_read(&self) -> Result<DirReadGuard<'_, FE>, Error>
Lock this directory for reading synchronously, if possible.
sourcepub async fn read_owned(&self) -> DirReadGuardOwned<FE>
pub async fn read_owned(&self) -> DirReadGuardOwned<FE>
Lock this directory for reading.
sourcepub fn try_read_owned(&self) -> Result<DirReadGuardOwned<FE>, Error>
pub fn try_read_owned(&self) -> Result<DirReadGuardOwned<FE>, Error>
Lock this directory for reading synchronously, if possible.
sourcepub async fn write(&self) -> DirWriteGuard<'_, FE>
pub async fn write(&self) -> DirWriteGuard<'_, FE>
Lock this directory for writing.
sourcepub async fn write_owned(&self) -> DirWriteGuardOwned<FE>
pub async fn write_owned(&self) -> DirWriteGuardOwned<FE>
Lock this directory for writing.
sourcepub async fn into_write(self) -> DirWriteGuardOwned<FE>
pub async fn into_write(self) -> DirWriteGuardOwned<FE>
Lock this directory for writing, without borrowing.
sourcepub fn try_write(&self) -> Result<DirWriteGuard<'_, FE>, Error>
pub fn try_write(&self) -> Result<DirWriteGuard<'_, FE>, Error>
Lock this directory for writing synchronously, if possible.
sourcepub fn try_write_owned(&self) -> Result<DirWriteGuardOwned<FE>, Error>
pub fn try_write_owned(&self) -> Result<DirWriteGuardOwned<FE>, Error>
Lock this directory for writing synchronously, if possible.
Trait Implementations§
Auto Trait Implementations§
impl<FE> !RefUnwindSafe for DirLock<FE>
impl<FE> Send for DirLock<FE>
impl<FE> Sync for DirLock<FE>
impl<FE> Unpin for DirLock<FE>
impl<FE> !UnwindSafe for DirLock<FE>
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<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
.