Rindle docs and package mapSkip to main content

UnionFanIn

Struct UnionFanIn 

Source
pub struct UnionFanIn {
    pub fan_out: NodeId,
    /* private fields */
}
Expand description

UnionFanIn (union-fan-in.ts): N branch inputs, one output. fetch k-way-merges the branch fetches with PK dedup (merge_node_streams). push either accumulates (during a fan-out broadcast — the owned model) or does a direct cross-branch dedup (a flipped child pushed while the fan-out is idle). On drain it collapses the accumulation via push_accumulated_changes and forwards the single result.

Fields§

§fan_out: NodeId

Implementations§

Source§

impl UnionFanIn

Source

pub fn new( fan_out: NodeId, inputs: Vec<NodeId>, branch_constraints: Vec<Constraint>, schema: Schema, ) -> UnionFanIn

Source

pub fn fetch<'g>( &'g self, g: &'g Graph, req: &FetchRequest, ) -> Box<dyn Iterator<Item = Node<'g>> + 'g>

fetch (union-fan-in.ts:103): k-way merge of the branch fetches in compare_rows order (reverse-aware), deduping consecutive PK-equal rows (a row matched by two branches is yielded once). Drop-clean.

Each branch is fetched through fetch_branch, which merges the branch’s build-time pushable constraint into the request — so an eq(pk) branch seeks the shared source instead of full-scanning it (an OR-branch constraint accumulation, not in the JS, which re-scans per branch).

Source

pub fn push<'g>(&'g self, g: &'g Graph, change: Change<'g>)

push (union-fan-in.ts:116): accumulate during a broadcast (materialize to owned before taking the borrow, so the reentrant relationship fetch in materialize_change_preserving_node never runs while the accumulation is borrowed), else a direct internal change.

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.