pub struct GraphProjection { /* private fields */ }Expand description
Materialized binary graph projection.
This view exposes OxGraph canonical topology through oxgraph-graph
traits. Outgoing arrays are CSR-shaped; incoming arrays are CSC-shaped.
§Performance
Cloning is O(n + m) for visible nodes and edges. Traversal is O(k) for
each yielded adjacency list.
Implementations§
Source§impl GraphProjection
impl GraphProjection
Sourcepub const fn definition(&self) -> &GraphProjectionDefinition
pub const fn definition(&self) -> &GraphProjectionDefinition
Trait Implementations§
Source§impl CanonicalElementIdentity for GraphProjection
impl CanonicalElementIdentity for GraphProjection
Source§type CanonicalElementId = ElementId
type CanonicalElementId = ElementId
Canonical element ID guaranteed by this view. Read more
Source§fn canonical_element_id(
&self,
element: Self::ElementId,
) -> Self::CanonicalElementId
fn canonical_element_id( &self, element: Self::ElementId, ) -> Self::CanonicalElementId
Returns the canonical ID for a visible local
element. Read moreSource§impl CanonicalRelationIdentity for GraphProjection
impl CanonicalRelationIdentity for GraphProjection
Source§type CanonicalRelationId = RelationId
type CanonicalRelationId = RelationId
Canonical relation ID guaranteed by this view. Read more
Source§fn canonical_relation_id(
&self,
relation: Self::RelationId,
) -> Self::CanonicalRelationId
fn canonical_relation_id( &self, relation: Self::RelationId, ) -> Self::CanonicalRelationId
Returns the canonical ID for a visible local
relation. Read moreSource§impl Clone for GraphProjection
impl Clone for GraphProjection
Source§fn clone(&self) -> GraphProjection
fn clone(&self) -> GraphProjection
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ContainsElement for GraphProjection
impl ContainsElement for GraphProjection
Source§impl ContainsRelation for GraphProjection
impl ContainsRelation for GraphProjection
Source§fn contains_relation(&self, relation: Self::RelationId) -> bool
fn contains_relation(&self, relation: Self::RelationId) -> bool
Returns whether
relation is valid and visible in this view. Read moreSource§impl Debug for GraphProjection
impl Debug for GraphProjection
Source§impl EdgeSourceGraph for GraphProjection
impl EdgeSourceGraph for GraphProjection
Source§fn source(&self, edge: Self::RelationId) -> Self::ElementId
fn source(&self, edge: Self::RelationId) -> Self::ElementId
Returns the source node of
edge. edge must be a valid edge ID.Source§impl EdgeTargetGraph for GraphProjection
impl EdgeTargetGraph for GraphProjection
Source§fn target(&self, edge: Self::RelationId) -> Self::ElementId
fn target(&self, edge: Self::RelationId) -> Self::ElementId
Returns the target node of
edge. edge must be a valid edge ID.Source§impl ElementIndex for GraphProjection
impl ElementIndex for GraphProjection
Source§impl ElementPredecessors for GraphProjection
impl ElementPredecessors for GraphProjection
Source§type Predecessors<'view> = Copied<Iter<'view, ProjectionElementId>>
where
Self: 'view
type Predecessors<'view> = Copied<Iter<'view, ProjectionElementId>> where Self: 'view
Iterator over predecessor element IDs reaching one element. Read more
Source§fn element_predecessors(
&self,
element: Self::ElementId,
) -> Self::Predecessors<'_>
fn element_predecessors( &self, element: Self::ElementId, ) -> Self::Predecessors<'_>
Returns elements that reach
element through outgoing connections. Read moreSource§impl ElementSuccessors for GraphProjection
impl ElementSuccessors for GraphProjection
Source§type Successors<'view> = Copied<Iter<'view, ProjectionElementId>>
where
Self: 'view
type Successors<'view> = Copied<Iter<'view, ProjectionElementId>> where Self: 'view
Iterator over successor element IDs reached from one element. Read more
Source§fn element_successors(&self, element: Self::ElementId) -> Self::Successors<'_>
fn element_successors(&self, element: Self::ElementId) -> Self::Successors<'_>
Returns elements reachable through outgoing connections from
element. Read moreimpl Eq for GraphProjection
Source§impl GraphCounts for GraphProjection
impl GraphCounts for GraphProjection
Source§fn node_count(&self) -> usize
fn node_count(&self) -> usize
Returns the number of nodes visible in this graph view.
Source§fn edge_count(&self) -> usize
fn edge_count(&self) -> usize
Returns the number of edges visible in this graph view.
Source§impl IncomingEdgeCount for GraphProjection
impl IncomingEdgeCount for GraphProjection
Source§impl IncomingGraph for GraphProjection
impl IncomingGraph for GraphProjection
Source§impl LocalElementIdentity for GraphProjection
impl LocalElementIdentity for GraphProjection
Source§fn local_element_id(
&self,
canonical: Self::CanonicalElementId,
) -> Option<Self::ElementId>
fn local_element_id( &self, canonical: Self::CanonicalElementId, ) -> Option<Self::ElementId>
Returns the visible local element for
canonical, if present. Read moreSource§impl LocalRelationIdentity for GraphProjection
impl LocalRelationIdentity for GraphProjection
Source§fn local_relation_id(
&self,
canonical: Self::CanonicalRelationId,
) -> Option<Self::RelationId>
fn local_relation_id( &self, canonical: Self::CanonicalRelationId, ) -> Option<Self::RelationId>
Returns the visible local relation for
canonical, if present. Read moreSource§impl OutgoingEdgeCount for GraphProjection
impl OutgoingEdgeCount for GraphProjection
Source§fn out_degree(&self, node: Self::ElementId) -> usize
fn out_degree(&self, node: Self::ElementId) -> usize
Returns the number of edges leaving
node.Source§impl OutgoingGraph for GraphProjection
impl OutgoingGraph for GraphProjection
Source§impl PartialEq for GraphProjection
impl PartialEq for GraphProjection
Source§fn eq(&self, other: &GraphProjection) -> bool
fn eq(&self, other: &GraphProjection) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl RelationIndex for GraphProjection
impl RelationIndex for GraphProjection
Source§fn relation_bound(&self) -> usize
fn relation_bound(&self) -> usize
Returns the exclusive upper bound for relation indexes in this view. Read more
Source§fn relation_index(&self, relation: Self::RelationId) -> usize
fn relation_index(&self, relation: Self::RelationId) -> usize
Returns the dense index for
relation in this view. Read moreimpl StructuralPartialEq for GraphProjection
Source§impl TopologyBase for GraphProjection
impl TopologyBase for GraphProjection
Source§type ElementId = ProjectionElementId
type ElementId = ProjectionElementId
Identity of a topology element. Read more
Source§type RelationId = ProjectionRelationId
type RelationId = ProjectionRelationId
Identity of a topology relation. Read more
Source§impl TopologyCounts for GraphProjection
impl TopologyCounts for GraphProjection
Source§fn element_count(&self) -> usize
fn element_count(&self) -> usize
Returns the number of elements visible in this topology view. Read more
Source§fn relation_count(&self) -> usize
fn relation_count(&self) -> usize
Returns the number of relations visible in this topology view. Read more
Auto Trait Implementations§
impl Freeze for GraphProjection
impl RefUnwindSafe for GraphProjection
impl Send for GraphProjection
impl Sync for GraphProjection
impl Unpin for GraphProjection
impl UnsafeUnpin for GraphProjection
impl UnwindSafe for GraphProjection
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ContainsEdge for Twhere
T: ContainsRelation,
impl<T> ContainsEdge for Twhere
T: ContainsRelation,
Source§fn contains_edge(&self, edge: Self::RelationId) -> bool
fn contains_edge(&self, edge: Self::RelationId) -> bool
Returns whether
edge is valid and visible in this graph view.Source§impl<T> ContainsHyperedge for Twhere
T: ContainsRelation,
impl<T> ContainsHyperedge for Twhere
T: ContainsRelation,
Source§fn contains_hyperedge(&self, hyperedge: Self::RelationId) -> bool
fn contains_hyperedge(&self, hyperedge: Self::RelationId) -> bool
Returns whether
hyperedge is valid and visible in this hypergraph view.Source§impl<T> ContainsNode for Twhere
T: ContainsElement,
impl<T> ContainsNode for Twhere
T: ContainsElement,
Source§fn contains_node(&self, node: Self::ElementId) -> bool
fn contains_node(&self, node: Self::ElementId) -> bool
Returns whether
node is valid and visible in this graph view.Source§impl<T> ContainsVertex for Twhere
T: ContainsElement,
impl<T> ContainsVertex for Twhere
T: ContainsElement,
Source§fn contains_vertex(&self, vertex: Self::ElementId) -> bool
fn contains_vertex(&self, vertex: Self::ElementId) -> bool
Returns whether
vertex is valid and visible in this hypergraph view.impl<T> DirectedGraph for T
Source§impl<T> DirectedVertexPredecessors for Twhere
T: ElementPredecessors,
impl<T> DirectedVertexPredecessors for Twhere
T: ElementPredecessors,
Source§type VertexPredecessors<'view> = <T as ElementPredecessors>::Predecessors<'view>
where
T: 'view
type VertexPredecessors<'view> = <T as ElementPredecessors>::Predecessors<'view> where T: 'view
Iterator over predecessor vertices reaching one target-side vertex.
Source§fn predecessor_vertices(
&self,
vertex: <T as TopologyBase>::ElementId,
) -> <T as DirectedVertexPredecessors>::VertexPredecessors<'_>
fn predecessor_vertices( &self, vertex: <T as TopologyBase>::ElementId, ) -> <T as DirectedVertexPredecessors>::VertexPredecessors<'_>
Returns source-side vertices that can reach
vertex.Source§impl<T> DirectedVertexSuccessors for Twhere
T: ElementSuccessors,
impl<T> DirectedVertexSuccessors for Twhere
T: ElementSuccessors,
Source§type VertexSuccessors<'view> = <T as ElementSuccessors>::Successors<'view>
where
T: 'view
type VertexSuccessors<'view> = <T as ElementSuccessors>::Successors<'view> where T: 'view
Iterator over successor vertices reachable from one source-side vertex.
Source§fn successor_vertices(
&self,
vertex: <T as TopologyBase>::ElementId,
) -> <T as DirectedVertexSuccessors>::VertexSuccessors<'_>
fn successor_vertices( &self, vertex: <T as TopologyBase>::ElementId, ) -> <T as DirectedVertexSuccessors>::VertexSuccessors<'_>
Returns target-side vertices reachable from
vertex.Source§impl<T> EdgeEndpointGraph for Twhere
T: EdgeSourceGraph + EdgeTargetGraph,
impl<T> EdgeEndpointGraph for Twhere
T: EdgeSourceGraph + EdgeTargetGraph,
Source§impl<T> EdgeIndex for Twhere
T: RelationIndex,
impl<T> EdgeIndex for Twhere
T: RelationIndex,
Source§fn edge_bound(&self) -> usize
fn edge_bound(&self) -> usize
Returns the exclusive upper bound for edge indexes in this graph view.
Source§fn edge_index(&self, edge: Self::RelationId) -> usize
fn edge_index(&self, edge: Self::RelationId) -> usize
Returns the dense index for
edge in this graph view.impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> ForwardGraph for Twhere
T: EdgeTargetGraph + OutgoingGraph,
impl<T> GraphBase for Twhere
T: TopologyBase,
Source§impl<T> HyperedgeIndex for Twhere
T: RelationIndex,
impl<T> HyperedgeIndex for Twhere
T: RelationIndex,
Source§fn hyperedge_bound(&self) -> usize
fn hyperedge_bound(&self) -> usize
Returns the exclusive upper bound for hyperedge indexes in this view.
Source§fn hyperedge_index(&self, hyperedge: Self::RelationId) -> usize
fn hyperedge_index(&self, hyperedge: Self::RelationId) -> usize
Returns the dense index for
hyperedge in this view.impl<T> HypergraphBase for Twhere
T: TopologyBase,
Source§impl<T> IncomingNeighborsGraph for Twhere
T: ElementPredecessors,
impl<T> IncomingNeighborsGraph for Twhere
T: ElementPredecessors,
Source§type InNeighbors<'view> = <T as ElementPredecessors>::Predecessors<'view>
where
T: 'view
type InNeighbors<'view> = <T as ElementPredecessors>::Predecessors<'view> where T: 'view
Iterator over nodes that have incoming edges to one target node.
Source§fn incoming_neighbors(
&self,
node: <T as TopologyBase>::ElementId,
) -> <T as IncomingNeighborsGraph>::InNeighbors<'_>
fn incoming_neighbors( &self, node: <T as TopologyBase>::ElementId, ) -> <T as IncomingNeighborsGraph>::InNeighbors<'_>
Returns predecessor nodes with incoming edges to
node.Source§impl<T> NodeIndex for Twhere
T: ElementIndex,
impl<T> NodeIndex for Twhere
T: ElementIndex,
Source§fn node_bound(&self) -> usize
fn node_bound(&self) -> usize
Returns the exclusive upper bound for node indexes in this graph view.
Source§fn node_index(&self, node: Self::ElementId) -> usize
fn node_index(&self, node: Self::ElementId) -> usize
Returns the dense index for
node in this graph view.Source§impl<T> OutgoingNeighborsGraph for Twhere
T: ElementSuccessors,
impl<T> OutgoingNeighborsGraph for Twhere
T: ElementSuccessors,
Source§type OutNeighbors<'view> = <T as ElementSuccessors>::Successors<'view>
where
T: 'view
type OutNeighbors<'view> = <T as ElementSuccessors>::Successors<'view> where T: 'view
Iterator over nodes directly reachable from one source node.
Source§fn outgoing_neighbors(
&self,
node: <T as TopologyBase>::ElementId,
) -> <T as OutgoingNeighborsGraph>::OutNeighbors<'_>
fn outgoing_neighbors( &self, node: <T as TopologyBase>::ElementId, ) -> <T as OutgoingNeighborsGraph>::OutNeighbors<'_>
Returns neighbor nodes reached by outgoing edges from
node.impl<T> ReverseGraph for Twhere
T: EdgeSourceGraph + IncomingGraph,
Source§impl<T> VertexIndex for Twhere
T: ElementIndex,
impl<T> VertexIndex for Twhere
T: ElementIndex,
Source§fn vertex_bound(&self) -> usize
fn vertex_bound(&self) -> usize
Returns the exclusive upper bound for vertex indexes in this view.
Source§fn vertex_index(&self, vertex: Self::ElementId) -> usize
fn vertex_index(&self, vertex: Self::ElementId) -> usize
Returns the dense index for
vertex in this view.