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