Skip to main content

Op

Enum Op 

pub enum Op {
    Append {
        events: Vec<Event>,
    },
    AppendConditional {
        events: Vec<Event>,
        query: Query,
        anchor: Anchor,
    },
#[non_exhaustive]
Read { query: Query, from: Anchor, to: Anchor, backwards: bool, limit: Option<usize>, }, }
Available on crate feature proptest only.
Expand description

One generated operation against the store under test.

The three are the whole of the port’s surface: an unconditional append, a conditional one, and a read. There is deliberately no empty-batch variant — ES-20’s ordering of NoEvents against ConditionViolated is pinned by two named rules, and generating it here would re-assert a settled thing in a test whose failures are harder to read.

Variants§

§

Append

Append a batch with no condition.

Fields

§events: Vec<Event>

The batch. Never empty.

§

AppendConditional

Append a batch guarded by a condition whose boundary is symbolic.

Fields

§events: Vec<Event>

The batch. Never empty.

§query: Query

What the condition fails on.

§anchor: Anchor

The condition’s exclusive after boundary.

§

#[non_exhaustive]
Read

Read, with every read option in play.

All five, since phase 12. The doc line above said “every read option” while the variant carried four of them, and the missing one was to — which made the two to branches of the model’s select dead code under a comment explaining why a model that ignores an option is worthless. A wrong store this file could not disagree with, WHERE a OR b AND position <= ?, is registered as UnparenthesisedToPredicateStore and is what closing this bought.

#[non_exhaustive] on the variant, so no downstream crate can build one directly and a downstream match must carry ... It landed in the release after to did, and deliberately not before: to’s arrival is the evidence for it. ReadOptions upstream is #[non_exhaustive] and grew to at phase 4 without breaking anybody; this variant mirrors that type option-for-option, did not carry the attribute, and so took the break ReadOptions was spared. limit’s own note below already names the next widening (VT-28), which is the same hole staying open.

This is not the thing RS-13-5 forbids, and the distinction is the whole reason it is here rather than on Op. That rule is about an enum designed not to grow, and Op is exactly that — its own doc above says the three are the whole of the port’s surface and argues a fourth out of existence. Enum-level would cost every downstream match a _ => arm forever, and permanently stop the compiler reporting a variant nobody will add. Variant-level costs a .. in one arm and buys the field additivity the variant demonstrably needs. Matching stays legal; construction does not.

Downstream, the struct spelling is the only one that matches, the same way it is for Query::Items — though the E0603 edge that rule records does not arise here, because this is a struct-form variant and has no tuple constructor to be made private.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§query: Query

What to match.

§from: Anchor

The inclusive from bound.

§to: Anchor

The inclusive to bound — the stopping end, which is the higher position reading forwards and the lower one reading backwards.

Generated independently of from, and the pairs where the two cross are kept rather than filtered out. A window whose ends are the wrong way round is an empty read, both here and in a conformant store, and an adapter that answers it with anything else is exactly the kind of thing this family exists to find.

§backwards: bool

Whether to read newest-first.

§limit: Option<usize>

A truncation, if any. Never zero — ReadOptions::limit(0) is None today and VT-28 owns changing that, in phase 4.

Trait Implementations§

§

impl Clone for Op

§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Op

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Op

§

impl RefUnwindSafe for Op

§

impl Send for Op

§

impl Sync for Op

§

impl Unpin for Op

§

impl UnsafeUnpin for Op

§

impl UnwindSafe for Op

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V