Rindle docs and package mapSkip to main content

NormalizedPublisher

Struct NormalizedPublisher 

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

Sender side: wraps a NormalizeFold, stamps batches with the subscription epoch + normalized_fp, and drives the gap-free seq. The caller drains the change-sink (the replica’s per-query CaughtChanges) and hands them to snapshot / commit.

Implementations§

Source§

impl NormalizedPublisher

Source

pub fn new( epoch: u64, ast: &Ast, schemas: Vec<TableWireSchema>, ) -> NormalizedPublisher

Open a publisher at epoch for ast, given the flat schema of every table the query’s tree can surface (root + every related/EXISTS child table). Bump epoch on a re-hydrate (§5.3). Panics if a surfaced table lacks a schema — a build-time config invariant (mirrors NormalizeFold’s validate_pk).

Source

pub fn hello(&self) -> &NormalizedHello

The handshake to send before any batch.

Source

pub fn epoch(&self) -> u64

The subscription epoch.

Source

pub fn snapshot(&mut self, caught: &[CaughtChange], cv: u64) -> NormalizedBatch

The hydrate snapshot (the pipeline’s CaughtChange::Adds from Graph::hydrate_change_sink) folded into a single seq-0 batch of add ops, at commit version cv (the watermark the hydrate reflects — Update::Hydrated’s tx_id). Always emitted — even for an empty result — so the receiver learns the baseline is set. Reserves the seq-0 slot; increments start at seq 1. Call once, before any commit.

Source

pub fn commit( &mut self, caught: &[CaughtChange], cv: u64, ) -> Option<NormalizedBatch>

Wrap one transaction’s drained changes, stamped with the transaction’s commit version cv (Update::Changed’s tx_id). Folds them through the persistent footprint and emits the net membership deltas. Returns None for a transaction that produced no net op — no batch, no seq consumed — keeping seq gap-free over emitted batches (an empty source tx, or one whose effects cancel within the footprint).

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
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.

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.