struct Held {
log: Arc<Wal>,
commits: Mutex<VecDeque<(Mark, RepoCommit)>>,
arrived: Condvar,
}Expand description
Commits handed over before the log they are written to has synced past them. See the module docs.
Fields§
§log: Arc<Wal>§commits: Mutex<VecDeque<(Mark, RepoCommit)>>Oldest first, each beside the position the log had reached when it arrived. The position is read under this lock, so the positions never go down.
arrived: CondvarSignalled when a commit arrives.
Implementations§
Source§impl Held
impl Held
fn over(log: Arc<Wal>) -> Self
fn lock(&self) -> MutexGuard<'_, VecDeque<(Mark, RepoCommit)>>
Sourcefn hold(&self, event: &RepoCommit)
fn hold(&self, event: &RepoCommit)
Holds event until the log has synced past where it is now, which is
past every entry the commit wrote.
Sourcefn oldest(&self, timeout: Duration) -> Option<Mark>
fn oldest(&self, timeout: Duration) -> Option<Mark>
The position the oldest held commit waits for, waiting up to
timeout for a commit when none is held.
Sourcefn take_through(&self, synced: Mark) -> Option<RepoCommit>
fn take_through(&self, synced: Mark) -> Option<RepoCommit>
The oldest held commit, if the log has synced through synced past
it.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Held
impl RefUnwindSafe for Held
impl Send for Held
impl Sync for Held
impl Unpin for Held
impl UnsafeUnpin for Held
impl UnwindSafe for Held
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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