pub(super) struct GuardWithDeferredDrop<'m> {
guard: Option<MutexGuard<'m, State>>,
deferred_drop: Vec<ProtectedArc<dyn IsParticipant>>,
}Expand description
MutexGuard<State> but also a list of Arc<dyn Participant> to drop when we unlock
Fields§
§guard: Option<MutexGuard<'m, State>>The mutex guard
Always Some; just an Option so we can move out during drop
deferred_drop: Vec<ProtectedArc<dyn IsParticipant>>The participants we’ve acquired and which we want to drop later
Implementations§
Source§impl<'m> GuardWithDeferredDrop<'m>
impl<'m> GuardWithDeferredDrop<'m>
Sourcepub(super) fn new(guard: MutexGuard<'m, State>) -> Self
pub(super) fn new(guard: MutexGuard<'m, State>) -> Self
Prepare for handling deferred drops
Sourcepub(super) fn deref_mut_both(
&mut self,
) -> (&mut State, &mut Vec<ProtectedArc<dyn IsParticipant>>)
pub(super) fn deref_mut_both( &mut self, ) -> (&mut State, &mut Vec<ProtectedArc<dyn IsParticipant>>)
Obtain mutable borrows of the two components
Methods from Deref<Target = State>§
Sourcefn get_aid_and_children_recursively(&self, parent_aid: AId) -> HashSet<AId>
fn get_aid_and_children_recursively(&self, parent_aid: AId) -> HashSet<AId>
Obtain all of the descendants of parent_aid according to the Child relation
The returned HashSet includes parent_aid, its children,
their children, and so on.
Used in the reclamation algorithm in reclaim.
Sourcefn prepare_parent_aid(&mut self, parent: &Account) -> Result<AId>
fn prepare_parent_aid(&mut self, parent: &Account) -> Result<AId>
Find and check the requested parent’s account ID
This function is responsible for garbage collecting dead children
from parent’s children. On successful return, a new child
can be added without extending children.
This is called in preparation for adding another account
to parent’s list of child accounts.
Returns an error if the specified parent account is not enabled,
or if it has been torn down.
Trait Implementations§
Source§impl<'m> Debug for GuardWithDeferredDrop<'m>
impl<'m> Debug for GuardWithDeferredDrop<'m>
Source§impl<'m> Default for GuardWithDeferredDrop<'m>
impl<'m> Default for GuardWithDeferredDrop<'m>
Source§fn default() -> GuardWithDeferredDrop<'m>
fn default() -> GuardWithDeferredDrop<'m>
Source§impl Deref for GuardWithDeferredDrop<'_>
impl Deref for GuardWithDeferredDrop<'_>
Source§impl DerefMut for GuardWithDeferredDrop<'_>
impl DerefMut for GuardWithDeferredDrop<'_>
Auto Trait Implementations§
impl<'m> Freeze for GuardWithDeferredDrop<'m>
impl<'m> !RefUnwindSafe for GuardWithDeferredDrop<'m>
impl<'m> !Send for GuardWithDeferredDrop<'m>
impl<'m> Sync for GuardWithDeferredDrop<'m>
impl<'m> Unpin for GuardWithDeferredDrop<'m>
impl<'m> UnsafeUnpin for GuardWithDeferredDrop<'m>
impl<'m> !UnwindSafe for GuardWithDeferredDrop<'m>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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> ⓘ
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> ⓘ
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