Rindle docs and package mapSkip to main content

Change

Enum Change 

Source
pub enum Change<'g> {
    Add(Node<'g>),
    Remove(Node<'g>),
    Edit {
        node: Node<'g>,
        old: Node<'g>,
    },
    Child {
        node: Node<'g>,
        rel: RelId,
        child: Box<Change<'g>>,
    },
}
Expand description

A downstream incremental change. Mirrors zql/src/ivm/change.ts but as a real tagged union (the JS uses a tuple where slot 2 aliases OLD_NODE / CHILD_DATA — the enum removes that aliasing footgun).

Variants§

§

Add(Node<'g>)

§

Remove(Node<'g>)

§

Edit

An in-place edit: the row’s PK is unchanged but some columns differ. Holds both the new node and the old node (makeEditChangechange.ts). A connection with split-edit keys never sees this (the source decomposes it into Remove(old)+Add(new) before fan-out, §3.6); it survives only for connections that don’t split.

Fields

§node: Node<'g>
§old: Node<'g>
§

Child

Fields

§node: Node<'g>
§rel: RelId

The relationship slot the child change belongs to (index, not a name — foundations §3.4). The View resolves it to a name via the schema.

§child: Box<Change<'g>>

Implementations§

Source§

impl<'g> Change<'g>

Source

pub fn change_type(&self) -> ChangeType

This change’s ChangeType discriminant (payload-free).

Source

pub fn primary_row(&self) -> &Row

The row identifying this change’s node (the new row for an Edit; the changed-child’s row for a Child). On a child-side join push this is the row whose join key selects the matching parents (join.ts#pushChildChange).

Auto Trait Implementations§

§

impl<'g> Freeze for Change<'g>

§

impl<'g> !RefUnwindSafe for Change<'g>

§

impl<'g> !Send for Change<'g>

§

impl<'g> !Sync for Change<'g>

§

impl<'g> Unpin for Change<'g>

§

impl<'g> UnsafeUnpin for Change<'g>

§

impl<'g> !UnwindSafe for Change<'g>

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.