Struct pgdo::coordinate::resource::ResourceShared
source · pub struct ResourceShared<'a, R: Subject + Faceted<'a>> { /* private fields */ }Expand description
A shared resource.
Implementations§
pub fn new(lock: LockedFileShared, inner: R) -> Self
sourcepub fn facet(&'a self) -> R::FacetShared
pub fn facet(&'a self) -> R::FacetShared
Return the Faceted::FacetShared of the wrapped resource.
sourcepub fn try_exclusive(
self
) -> Result<Either<Self, ResourceExclusive<'a, R>>, CoordinateError<R::Error>>
pub fn try_exclusive( self ) -> Result<Either<Self, ResourceExclusive<'a, R>>, CoordinateError<R::Error>>
Attempt to obtain an exclusive lock on the resource.
sourcepub fn exclusive(
self
) -> Result<ResourceExclusive<'a, R>, CoordinateError<R::Error>>
pub fn exclusive( self ) -> Result<ResourceExclusive<'a, R>, CoordinateError<R::Error>>
Obtain an exclusive 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§
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