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
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