Skip to main content

ViewStore

Struct ViewStore 

Source
pub struct ViewStore { /* private fields */ }

Implementations§

Source§

impl ViewStore

Source

pub fn new() -> ViewStore

Source

pub fn views(&self) -> impl Iterator<Item = &ViewDef>

Source

pub fn is_empty(&self) -> bool

Source

pub fn has_view(&self, name: &str) -> bool

Source

pub fn view_for_prop(&self, prop_name: &str) -> Option<&str>

If prop_name is managed by any view, return that view’s name.

Source

pub fn create_view( &mut self, def: ViewDef, props: &mut ColumnStore, topo: &TopologyView<'_>, ids: &IdMap, syms: &Interner, labels: &[u32], ) -> Result<(), String>

Register a view and backfill values for all existing nodes.

§Errors
  • Duplicate view name.
  • view_prop already claimed by another view.
  • view_prop already present as a real node property in ColumnStore.
Source

pub fn restore_view(&mut self, def: ViewDef) -> Result<(), String>

Restore a view definition from a snapshot without collision checking or backfilling. The snapshot’s ColumnStore already contains view values; this method simply registers the definition so the store is aware of it.

Called only from open_with during snapshot restore. Callers must then call rebuild_all to ensure values are correct after WAL replay.

Source

pub fn delete_view( &mut self, name: &str, props: &mut ColumnStore, ids: &IdMap, labels: &[u32], syms: &Interner, ) -> Result<(), String>

Remove a view and delete its values from every node.

§Errors
  • View not found.
Source

pub fn on_edge_changed( &self, etype: u32, src: u32, dst: u32, inserted: bool, props: &mut ColumnStore, topo: &TopologyView<'_>, ids: &IdMap, syms: &Interner, labels: &[u32], base_cols: Option<&ArchivedColumnsData>, )

Called when an edge of type etype (symbol) between src and dst is inserted (inserted=true) or deleted (inserted=false).

Covers both manual user edges and derived engine edges. The topo must already reflect the new state (edge added before this call on insert; edge removed before this call on delete) so that full-recompute paths (Avg, Min, Max) see correct neighbor sets.

Source

pub fn on_prop_changed( &self, changed_node: u32, field: &str, props: &mut ColumnStore, topo: &TopologyView<'_>, ids: &IdMap, syms: &Interner, labels: &[u32], base_cols: Option<&ArchivedColumnsData>, )

Called after SetProp / RemoveProp — finds NeighborAgg views that read field from neighbors and recomputes values for all subject nodes.

Source

pub fn init_node_views( &self, node: u32, props: &mut ColumnStore, syms: &Interner, labels: &[u32], )

Initialize view values for a newly inserted node.

Sets Degree, Count, and Sum views to their zero values (0 / 0.0). Avg / Min / Max are left absent — there is no sensible neutral value when no neighbors have been observed yet.

Call this BEFORE the rule engine’s on_node_changed for the new node so that subsequent on_edge_changed calls (from derived-edge deltas) can increment correctly from a known baseline.

Source

pub fn rebuild_all( &self, props: &mut ColumnStore, topo: &TopologyView<'_>, ids: &IdMap, syms: &Interner, labels: &[u32], )

Recompute all view values from scratch. Called on open after WAL replay so values are consistent with persisted graph state.

Trait Implementations§

Source§

impl Clone for ViewStore

Source§

fn clone(&self) -> ViewStore

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 ViewStore

Source§

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

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

impl Default for ViewStore

Source§

fn default() -> ViewStore

Returns the “default value” for a type. 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> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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> 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.

Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
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, <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.