Struct pgdo::coordinate::resource::ResourceFree
source · pub struct ResourceFree<'a, R: Subject + Faceted<'a>> { /* private fields */ }Expand description
An unlocked/free resource.
Implementations§
source§impl<'a, R> ResourceFree<'a, R>
impl<'a, R> ResourceFree<'a, R>
pub fn new(lock: UnlockedFile, inner: R) -> Self
sourcepub fn facet(&'a self) -> R::FacetFree
pub fn facet(&'a self) -> R::FacetFree
Return the Faceted::FacetFree 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_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 into_parts(self) -> (UnlockedFile, R)
pub fn into_parts(self) -> (UnlockedFile, R)
Disassembles this resource into the lock and the inner, managed, value. This can only be done from an unlocked/free resource.
Auto Trait Implementations§
impl<'a, R> RefUnwindSafe for ResourceFree<'a, R>where
R: RefUnwindSafe,
impl<'a, R> Send for ResourceFree<'a, R>
impl<'a, R> Sync for ResourceFree<'a, R>where
R: Sync,
impl<'a, R> Unpin for ResourceFree<'a, R>where
R: Unpin,
impl<'a, R> UnwindSafe for ResourceFree<'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