Skip to main content

KvCappedFixture

Struct KvCappedFixture 

Source
pub struct KvCappedFixture { /* private fields */ }
Expand description

A SyncFixture whose peer stores each event as one KV value of at most KV_VALUE_CAP bytes: Turnstile’s peer D, the shape SY-18’s marker names.

§What it declares, and why

A value holds the event’s type, its tags and a 32-byte key as well as its payload, and [PeerLimits] has a field for the payload alone. So the peer reserves the envelope at the contract’s floors and declares what is left:

bytes
value cap131,072
type, at MAX_EVENT_TYPE_LEN255
64 tags, at MAX_TAG_LEN each16,320
key: origin, position, recorded time32
declared max_event_bytes114,465

An event at every floor at once fills a value exactly, and is accepted. The declaration clears VT-21’s 65,536-byte floor with 48,929 bytes to spare, and sits in the peer set’s spread as: floor 65,536 = [MemorySyncPeer] < this peer 114,465 < the Neon store’s 131,072 < 1 MiB for SQLite, Postgres and Cloudflare.

§What it refuses

A push holding any event whose value would exceed the cap is refused whole, before anything is stored, with KvPeerError::ValueTooLarge, class [FailureClass::Park]. It never truncates. A push over max_batch_bytes is refused by the store behind the cap, class [FailureClass::Split].

Implementations§

Source§

impl KvCappedFixture

Source

pub fn new() -> Self

A fixture over a fresh capped peer.

Trait Implementations§

Source§

impl Clone for KvCappedFixture

Source§

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
Source§

impl Debug for KvCappedFixture

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for KvCappedFixture

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl SyncFixture for KvCappedFixture

Source§

const REOPEN: Capability

Declined, by incapacity, as the reference fixture’s is.

Source§

const COMPACTION: Capability = Capability::SUPPORTED

The capped peer compacts as the reference peer behind it does: a cap on values says nothing about retention.

Source§

async fn refusals(&self, peer: &Self::Peer) -> RefusalsOf<Self::Peer>

The oversized push, declared Split, and the Turnstile seat map, declared Park: 340,000 bytes is under the batch limit and over a value, so it is the value cap that refuses it.

Source§

type Peer = KvCappedPeer

The peer adapter under test.
Source§

async fn connect(&self) -> Self::Peer

A handle onto this fixture’s backing peer.
Source§

async fn compact_recorded_before( &self, peer: &Self::Peer, cutoff: RecordedAt, ) -> Result<(), Violation>

Makes peer forget the longest prefix of its log, in its forwarding order, in which every event was recorded before cutoff, as the fixture’s adapter compacts on a retention window (SY-32). Read more
Source§

fn reopen(&self) -> impl Future<Output = Reopened>

Closes and reopens the backing peer, discarding every outstanding handle’s process-level state, and says whether it did. Read more

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