pub struct Schema { /* private fields */ }Expand description
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn relation_type(self, name: &str) -> Self
pub fn relation_type(self, name: &str) -> Self
Sourcepub fn key<T: ValueType>(self, name: &str, family: PropertyFamily) -> Self
pub fn key<T: ValueType>(self, name: &str, family: PropertyFamily) -> Self
Declares a typed property key in family whose value type is T.
§Performance
This method is O(name length).
Sourcepub fn equality_index(self, name: &str, key: &str) -> Self
pub fn equality_index(self, name: &str, key: &str) -> Self
Declares an equality index named name over the property key key.
§Performance
This method is O(name lengths).
Sourcepub fn graph_projection(
self,
name: &str,
relation_types: &[&str],
source_role: &str,
target_role: &str,
) -> Self
pub fn graph_projection( self, name: &str, relation_types: &[&str], source_role: &str, target_role: &str, ) -> Self
Declares a binary graph projection over relation_types, traversing from
source_role to target_role.
§Performance
This method is O(relation-type count + name lengths).
Sourcepub fn hypergraph_projection(
self,
name: &str,
relation_types: &[&str],
source_roles: &[&str],
target_roles: &[&str],
) -> Self
pub fn hypergraph_projection( self, name: &str, relation_types: &[&str], source_roles: &[&str], target_roles: &[&str], ) -> Self
Declares a directed hypergraph projection over relation_types, treating
incidences in source_roles as source-side participants and those in
target_roles as target-side participants.
The role-name slices must be non-empty: a hypergraph projection
materializes only relations carrying at least one source and one target
participant (enforced when
Reader::hypergraph_projection builds the
view).
§Performance
This method is O(relation-type count + role count + name lengths).
Sourcepub fn fingerprint(&self) -> u64
pub fn fingerprint(&self) -> u64
Returns a content fingerprint of the declared schema shape: every role, label, relation type, typed key, equality index, and projection. Equal shapes hash equally regardless of declaration order; any change to a declared item changes the fingerprint.
A consumer can fold this into its own index-staleness digest so a schema change forces a rebuild even when no source content changed. This is a non-cryptographic content hash, not a cross-compiler-version stability guarantee.
§Performance
This method is O(declared items × name lengths + items × log items).