Struct pgdo::coordinate::resource::ResourceExclusive
source · pub struct ResourceExclusive<'a, R: Subject + Faceted<'a>> { /* private fields */ }Expand description
A resource held exclusively.
Implementations§
source§impl<'a, R> ResourceExclusive<'a, R>
impl<'a, R> ResourceExclusive<'a, R>
pub fn new(lock: LockedFileExclusive, inner: R) -> Self
sourcepub fn facet(&'a self) -> R::FacetExclusive
pub fn facet(&'a self) -> R::FacetExclusive
Return the Faceted::FacetExclusive of the wrapped resource.
Attempt to obtain a shared lock on the resource.
Obtain a shared lock on the resource. Can block indefinitely.
sourcepub fn try_release(
self
) -> Result<Either<Self, ResourceFree<'a, R>>, CoordinateError<R::Error>>
pub fn try_release( self ) -> Result<Either<Self, ResourceFree<'a, R>>, CoordinateError<R::Error>>
Attempt to release this resource.
sourcepub fn release(self) -> Result<ResourceFree<'a, R>, CoordinateError<R::Error>>
pub fn release(self) -> Result<ResourceFree<'a, R>, CoordinateError<R::Error>>
Release this resource. Can block indefinitely.
Auto Trait Implementations§
impl<'a, R> Freeze for ResourceExclusive<'a, R>where
R: Freeze,
impl<'a, R> RefUnwindSafe for ResourceExclusive<'a, R>where
R: RefUnwindSafe,
impl<'a, R> Send for ResourceExclusive<'a, R>
impl<'a, R> Sync for ResourceExclusive<'a, R>where
R: Sync,
impl<'a, R> Unpin for ResourceExclusive<'a, R>where
R: Unpin,
impl<'a, R> UnwindSafe for ResourceExclusive<'a, R>where
R: UnwindSafe + RefUnwindSafe,
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