pub struct ViewStore { /* private fields */ }Implementations§
Source§impl ViewStore
impl ViewStore
pub fn new() -> ViewStore
pub fn views(&self) -> impl Iterator<Item = &ViewDef>
pub fn is_empty(&self) -> bool
pub fn has_view(&self, name: &str) -> bool
Sourcepub fn view_for_prop(&self, prop_name: &str) -> Option<&str>
pub fn view_for_prop(&self, prop_name: &str) -> Option<&str>
If prop_name is managed by any view, return that view’s name.
Sourcepub fn create_view(
&mut self,
def: ViewDef,
props: &mut ColumnStore,
topo: &TopologyView<'_>,
ids: &IdMap,
syms: &Interner,
labels: &[u32],
) -> Result<(), String>
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_propalready claimed by another view.view_propalready present as a real node property inColumnStore.
Sourcepub fn restore_view(&mut self, def: ViewDef) -> Result<(), String>
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.
Sourcepub fn delete_view(
&mut self,
name: &str,
props: &mut ColumnStore,
ids: &IdMap,
labels: &[u32],
syms: &Interner,
) -> Result<(), String>
pub fn delete_view( &mut self, name: &str, props: &mut ColumnStore, ids: &IdMap, labels: &[u32], syms: &Interner, ) -> Result<(), String>
Sourcepub 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>,
)
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.
Sourcepub 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>,
)
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.
Sourcepub fn init_node_views(
&self,
node: u32,
props: &mut ColumnStore,
syms: &Interner,
labels: &[u32],
)
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.
Sourcepub fn rebuild_all(
&self,
props: &mut ColumnStore,
topo: &TopologyView<'_>,
ids: &IdMap,
syms: &Interner,
labels: &[u32],
)
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§
Auto Trait Implementations§
impl Freeze for ViewStore
impl RefUnwindSafe for ViewStore
impl Send for ViewStore
impl Sync for ViewStore
impl Unpin for ViewStore
impl UnsafeUnpin for ViewStore
impl UnwindSafe for ViewStore
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.