pub struct ReadTransaction { /* private fields */ }Expand description
Read transaction over a pinned state snapshot.
§Performance
Moving a read transaction is O(database state size).
Implementations§
Source§impl ReadTransaction
impl ReadTransaction
Sourcepub fn element_count(&self) -> usize
pub fn element_count(&self) -> usize
Sourcepub fn relation_count(&self) -> usize
pub fn relation_count(&self) -> usize
Sourcepub fn incidence_count(&self) -> usize
pub fn incidence_count(&self) -> usize
Sourcepub fn contains_element(&self, id: ElementId) -> bool
pub fn contains_element(&self, id: ElementId) -> bool
Sourcepub fn contains_relation(&self, id: RelationId) -> bool
pub fn contains_relation(&self, id: RelationId) -> bool
Sourcepub fn contains_incidence(&self, id: IncidenceId) -> bool
pub fn contains_incidence(&self, id: IncidenceId) -> bool
Sourcepub fn element(&self, id: ElementId) -> Option<&ElementRecord>
pub fn element(&self, id: ElementId) -> Option<&ElementRecord>
Sourcepub fn relation(&self, id: RelationId) -> Option<&RelationRecord>
pub fn relation(&self, id: RelationId) -> Option<&RelationRecord>
Sourcepub fn incidence(&self, id: IncidenceId) -> Option<&IncidenceRecord>
pub fn incidence(&self, id: IncidenceId) -> Option<&IncidenceRecord>
Sourcepub fn element_incidences(
&self,
id: ElementId,
) -> impl Iterator<Item = &IncidenceRecord>
pub fn element_incidences( &self, id: ElementId, ) -> impl Iterator<Item = &IncidenceRecord>
Iterates incidences attached to an element.
§Performance
This method is O(i) for visible incidence count.
Sourcepub fn property(
&self,
subject: PropertySubject,
key: PropertyKeyId,
) -> Option<&PropertyValue>
pub fn property( &self, subject: PropertySubject, key: PropertyKeyId, ) -> Option<&PropertyValue>
Sourcepub fn lookup_property_equal(
&self,
key: PropertyKeyId,
value: &PropertyValue,
) -> Result<Vec<PropertySubject>, DbError>
pub fn lookup_property_equal( &self, key: PropertyKeyId, value: &PropertyValue, ) -> Result<Vec<PropertySubject>, DbError>
Sourcepub fn lookup_property_range(
&self,
key: PropertyKeyId,
min: &PropertyValue,
max: &PropertyValue,
) -> Result<Vec<PropertySubject>, DbError>
pub fn lookup_property_range( &self, key: PropertyKeyId, min: &PropertyValue, max: &PropertyValue, ) -> Result<Vec<PropertySubject>, DbError>
Sourcepub fn lookup_index(
&self,
index: IndexId,
lookup: IndexLookup<'_>,
) -> Result<Vec<PropertySubject>, DbError>
pub fn lookup_index( &self, index: IndexId, lookup: IndexLookup<'_>, ) -> Result<Vec<PropertySubject>, DbError>
Sourcepub fn graph_projection(
&self,
id: ProjectionId,
) -> Result<GraphProjection, DbError>
pub fn graph_projection( &self, id: ProjectionId, ) -> Result<GraphProjection, DbError>
Sourcepub fn graph_projection_by_name(
&self,
name: &str,
) -> Result<GraphProjection, DbError>
pub fn graph_projection_by_name( &self, name: &str, ) -> Result<GraphProjection, DbError>
Sourcepub fn traverse_graph(
&self,
projection: ProjectionId,
seeds: &[ElementId],
options: TraversalOptions,
) -> Result<TraversalResult, DbError>
pub fn traverse_graph( &self, projection: ProjectionId, seeds: &[ElementId], options: TraversalOptions, ) -> Result<TraversalResult, DbError>
Traverses a cataloged graph projection from canonical seed elements.
Rows are unique canonical elements in BFS first-discovery order. Depth is the shortest discovered hop count from any seed.
§Errors
Returns DbError when the projection is unknown, is not a graph,
cannot be materialized, or a seed element is not part of the projection.
§Performance
This method is O(relation count * incidence count + visited edges).
Sourcepub fn hypergraph_projection(
&self,
id: ProjectionId,
) -> Result<HypergraphProjection, DbError>
pub fn hypergraph_projection( &self, id: ProjectionId, ) -> Result<HypergraphProjection, DbError>
Sourcepub fn execute(&self, query: &PreparedQuery) -> Result<QueryResult, DbError>
pub fn execute(&self, query: &PreparedQuery) -> Result<QueryResult, DbError>
Sourcepub fn explain(&self, query: &PreparedQuery) -> String
pub fn explain(&self, query: &PreparedQuery) -> String
Auto Trait Implementations§
impl Freeze for ReadTransaction
impl RefUnwindSafe for ReadTransaction
impl Send for ReadTransaction
impl Sync for ReadTransaction
impl Unpin for ReadTransaction
impl UnsafeUnpin for ReadTransaction
impl UnwindSafe for ReadTransaction
Blanket Implementations§
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
Mutably borrows from an owned value. Read more