Struct MemoryFixture
pub struct MemoryFixture(/* private fields */);Expand description
The reference Fixture: one MemoryEventStore, any number of handles.
This is the oracle the suite is validated against, and it is also the worked example an adapter author reads before writing their own fixture. Two things in it are worth copying:
connectis anArcclone. A handle owns a refcount into the backing store rather than borrowing a lifetime from the fixture, which is what letsFixture::Storebe an ordinary associated type instead of a GAT. A pool-backed fixture does the same thing with a pool; a!Sendfixture does it with anRc.REOPENis declined with the real reason.MemoryFixtureis the workspace’s first fixture to decline anything, which is what makes the skip machinery non-vacuous — until something declines a capability, “a skip is reported” is a claim about code no fixture executes.
It also states no CF-40 store limit, inheriting None three times, so
append_reports_exceeded_store_limits reports a skip against it. That is the
honest answer — MemoryEventStore has no ceiling on a payload, a tag count or
a batch size — and it is the first rule in the suite the reference fixture
cannot run. GappedPositionFixture in the testkit’s own
tests/mutation_coverage/variants.rs is the conformant variant that states
all three and enforces them, which is what keeps the rule non-vacuous.
Implementations§
§impl MemoryFixture
impl MemoryFixture
pub fn new() -> Self
pub fn new() -> Self
Creates a fixture over a new, empty MemoryEventStore.
pub fn sharing(store: Arc<MemoryEventStore>) -> Self
pub fn sharing(store: Arc<MemoryEventStore>) -> Self
Creates a fixture over an existing store, which is a way of deliberately breaking isolation.
This is not a convenience, and it is not what an adapter’s fixture should
look like. It exists so that
two_fixture_instances_observe_none_of_each_others_appends
can be shown to fail: handing every instance the same Arc reproduces,
in memory, the file-backed adapter that points every fixture at one
temporary path. A rule no implementation can fail is decorative, and this
is the implementation that fails this one.
Nothing else in the workspace should call it.
Trait Implementations§
§impl Debug for MemoryFixture
impl Debug for MemoryFixture
§impl Default for MemoryFixture
impl Default for MemoryFixture
§impl Fixture for MemoryFixture
impl Fixture for MemoryFixture
§const SECOND_HANDLE: Capability = Capability::SUPPORTED
const SECOND_HANDLE: Capability = Capability::SUPPORTED
§const REOPEN: Capability
const REOPEN: Capability
§const MID_BATCH_FAULT: Capability
const MID_BATCH_FAULT: Capability
§const READ_FAULT: Capability
const READ_FAULT: Capability
read. Read more§const HELD_ABOVE_FRONTIER: Capability
const HELD_ABOVE_FRONTIER: Capability
read does not yet show. Read more§const REMOVAL: Capability
const REMOVAL: Capability
EventStore does not have. Read more§type Store = MemoryHandle
type Store = MemoryHandle
§fn connect(&self) -> impl Future<Output = Self::Store>
fn connect(&self) -> impl Future<Output = Self::Store>
§const READ_YOUR_OWN_WRITES: Capability = Capability::SUPPORTED
const READ_YOUR_OWN_WRITES: Capability = Capability::SUPPORTED
§const MAX_EVENT_DATA_LEN: Option<usize> = None
const MAX_EVENT_DATA_LEN: Option<usize> = None
data payload this fixture’s store accepts, in bytes, or
None if it has no ceiling. Read more§const MAX_TAGS_PER_EVENT: Option<usize> = None
const MAX_TAGS_PER_EVENT: Option<usize> = None
None if it has no ceiling. Read more§const MAX_EVENTS_PER_BATCH: Option<usize> = None
const MAX_EVENTS_PER_BATCH: Option<usize> = None
None if it has no ceiling. Read more§const MAX_METADATA_LEN: Option<usize> = None
const MAX_METADATA_LEN: Option<usize> = None
metadata on one event this fixture’s store accepts, in
bytes, or None if it has no ceiling. Read more§const MAX_TAGS_PER_BATCH: Option<usize> = None
const MAX_TAGS_PER_BATCH: Option<usize> = None
None if it has no ceiling beyond the one
MAX_EVENTS_PER_BATCH ×
MAX_TAGS_PER_EVENT already implies. Read more§fn arm_mid_batch_fault(&self, after: usize) -> impl Future<Output = ()>
fn arm_mid_batch_fault(&self, after: usize) -> impl Future<Output = ()>
after events
fails while writing event after + 1. Read more§fn arm_read_fault(&self) -> impl Future<Output = ()>
fn arm_read_fault(&self) -> impl Future<Output = ()>
read fails part way through. Read more§fn reopen(&self) -> impl Future<Output = ()>
fn reopen(&self) -> impl Future<Output = ()>
§fn arm_held_above_frontier(&self) -> impl Future<Output = Armed>
fn arm_held_above_frontier(&self) -> impl Future<Output = Armed>
read and head do not show
it, and the store still holds it. Read more§fn settle_frontier(&self) -> impl Future<Output = Settled>
fn settle_frontier(&self) -> impl Future<Output = Settled>
§fn remove_outside_port(
&self,
positions: &[SequencePosition],
) -> impl Future<Output = Removed>
fn remove_outside_port( &self, positions: &[SequencePosition], ) -> impl Future<Output = Removed>
positions outside EventStore
(a raw DELETE on the adapter’s own storage), and says whether it did. Read more