pub struct InMemoryJobRepository { /* private fields */ }Expand description
Deterministic, process-local reference implementation of JobRepository.
Each unit of work operates on an isolated snapshot and publishes it with a
repository-wide compare-and-swap commit. Concurrent commits therefore have
one winner; losers receive RepositoryError::ConcurrentModification and
can retry from a fresh snapshot. No state survives process termination.
Implementations§
Source§impl InMemoryJobRepository
impl InMemoryJobRepository
Sourcepub fn new(clock: Arc<dyn Clock>, ids: Arc<dyn IdGenerator>) -> Self
pub fn new(clock: Arc<dyn Clock>, ids: Arc<dyn IdGenerator>) -> Self
Constructs an empty repository with explicitly injected time and IDs.
Sourcepub fn inject_next_partition_aggregate_commit_unknown(&self)
pub fn inject_next_partition_aggregate_commit_unknown(&self)
Injects one lost commit response after the next partition aggregate is published.
This deterministic failure fixture is intended for conformance tests of fresh-state inspection after an ambiguous repository commit.
Trait Implementations§
Source§impl Clone for InMemoryJobRepository
impl Clone for InMemoryJobRepository
Source§fn clone(&self) -> InMemoryJobRepository
fn clone(&self) -> InMemoryJobRepository
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InMemoryJobRepository
impl Debug for InMemoryJobRepository
Source§impl JobRepository for InMemoryJobRepository
impl JobRepository for InMemoryJobRepository
Source§fn descriptor(&self) -> RepositoryDescriptor
fn descriptor(&self) -> RepositoryDescriptor
The reference adapter implements every capability this milestone
defines. It reports schema version 0 because it holds no durable
metadata schema.
Source§fn connection_capacity(&self) -> u32
fn connection_capacity(&self) -> u32
Source§fn begin<'a>(
&'a self,
) -> BoxFuture<'a, Result<Box<dyn RepositoryUnitOfWork + 'a>, RepositoryError>>
fn begin<'a>( &'a self, ) -> BoxFuture<'a, Result<Box<dyn RepositoryUnitOfWork + 'a>, RepositoryError>>
Auto Trait Implementations§
impl !RefUnwindSafe for InMemoryJobRepository
impl !UnwindSafe for InMemoryJobRepository
impl Freeze for InMemoryJobRepository
impl Send for InMemoryJobRepository
impl Sync for InMemoryJobRepository
impl Unpin for InMemoryJobRepository
impl UnsafeUnpin for InMemoryJobRepository
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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