Skip to main content

Anchor

Enum Anchor 

pub enum Anchor {
    Unset,
    First,
    Middle,
    Head,
    BeyondHead,
}
Available on crate feature proptest only.
Expand description

A position named by description rather than by value.

The generator emits these; the runner resolves one into a real SequencePosition against the log the store has built so far. See the module documentation for why a generated literal would be meaningless.

The runbook spells the first variant None. It is Unset here so that a match arm cannot be read as Option::None — the resolution of every variant is an Option, and two Nones in one match are one mistake away from each other.

Variants§

§

Unset

No position at all: an unbounded read, or a condition over the whole log.

§

First

The lowest position the store has assigned.

§

Middle

A position in the middle of the assigned range.

It coincides with the neighbouring anchors on short logs, and a shrunk counterexample is exactly where short logs live, so the next reader needs to know before they go looking at the wrong half of their adapter. Resolution is positions[len / 2], so Middle is Head at len == 2 and is both First and Head at len == 1; a strictly interior position only exists from three events up.

Biasing the index down — (len - 1) / 2 — was considered and rejected: it only moves the collapse at len == 2 from Head to First, which is no less misleading, and it perturbs the deterministic generator that the proof artefact’s per-store coverage claims are pinned against. Naming the coincidence costs nothing and is honest at every length.

§

Head

The highest position the store has assigned.

§

BeyondHead

A position the store has not assigned, above everything it has.

Trait Implementations§

§

impl Clone for Anchor

§

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 Copy for Anchor

§

impl Debug for Anchor

§

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

Formats the value using the given formatter. Read more
§

impl Eq for Anchor

§

impl PartialEq for Anchor

§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
§

impl StructuralPartialEq for Anchor

Auto Trait Implementations§

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