pub struct SpecFlowGraphV2 { /* private fields */ }Expand description
SpecFlowGraph V2 - SoA + Side Tables design.
NOTE: Deserialize is NOT derived because SpecFlowGraphV2 contains HashMap<SymbolId, …>. SymbolId is process-specific. Serialize is kept for debugging/inspection.
Implementations§
Source§impl SpecFlowGraphV2
impl SpecFlowGraphV2
Sourcepub fn add_group(
&mut self,
name: impl Into<String>,
description: Option<String>,
) -> SpecNodeId
pub fn add_group( &mut self, name: impl Into<String>, description: Option<String>, ) -> SpecNodeId
Add a group, returning its ID. Reuses existing if name matches.
Sourcepub fn add_spec_alias(
&mut self,
alias_id: SymbolId,
alias_name: String,
group_name: &str,
wrapped_type_id: Option<SymbolId>,
wrapped_type_name: Option<String>,
source: SpecSource,
) -> SpecNodeId
pub fn add_spec_alias( &mut self, alias_id: SymbolId, alias_name: String, group_name: &str, wrapped_type_id: Option<SymbolId>, wrapped_type_name: Option<String>, source: SpecSource, ) -> SpecNodeId
Add a spec alias.
Sourcepub fn add_constraint(&mut self, kind: ConstraintKind) -> SpecNodeId
pub fn add_constraint(&mut self, kind: ConstraintKind) -> SpecNodeId
Add a constraint.
Sourcepub fn add_intent(
&mut self,
description: impl Into<String>,
kind: IntentKind,
) -> SpecNodeId
pub fn add_intent( &mut self, description: impl Into<String>, kind: IntentKind, ) -> SpecNodeId
Add an intent.
Sourcepub fn add_dependency(&mut self, from: SpecNodeId, to: SpecNodeId)
pub fn add_dependency(&mut self, from: SpecNodeId, to: SpecNodeId)
Add dependency: from depends on to.
Add related edge (bidirectional).
Sourcepub fn link_constraint(&mut self, spec: SpecNodeId, constraint: SpecNodeId)
pub fn link_constraint(&mut self, spec: SpecNodeId, constraint: SpecNodeId)
Link constraint to spec.
Sourcepub fn link_intent(&mut self, spec: SpecNodeId, intent: SpecNodeId)
pub fn link_intent(&mut self, spec: SpecNodeId, intent: SpecNodeId)
Link intent to spec.
Sourcepub fn group_by_name(&self, name: &str) -> Option<SpecNodeId>
pub fn group_by_name(&self, name: &str) -> Option<SpecNodeId>
Get group by name. O(1)
Sourcepub fn spec_by_symbol(&self, id: SymbolId) -> Option<SpecNodeId>
pub fn spec_by_symbol(&self, id: SymbolId) -> Option<SpecNodeId>
Get spec by SymbolId. O(1)
Sourcepub fn specs_in_group(
&self,
group: SpecNodeId,
) -> impl Iterator<Item = SpecNodeId> + '_
pub fn specs_in_group( &self, group: SpecNodeId, ) -> impl Iterator<Item = SpecNodeId> + '_
Get all specs in a group. O(1)
Sourcepub fn dependencies(
&self,
spec: SpecNodeId,
) -> impl Iterator<Item = SpecNodeId> + '_
pub fn dependencies( &self, spec: SpecNodeId, ) -> impl Iterator<Item = SpecNodeId> + '_
Get dependencies of a spec. O(1)
Sourcepub fn constraints(
&self,
spec: SpecNodeId,
) -> impl Iterator<Item = SpecNodeId> + '_
pub fn constraints( &self, spec: SpecNodeId, ) -> impl Iterator<Item = SpecNodeId> + '_
Get constraints of a spec. O(1)
Sourcepub fn get_group(&self, id: SpecNodeId) -> Option<&GroupData>
pub fn get_group(&self, id: SpecNodeId) -> Option<&GroupData>
Get group data.
Sourcepub fn get_spec_alias(&self, id: SpecNodeId) -> Option<&SpecAliasData>
pub fn get_spec_alias(&self, id: SpecNodeId) -> Option<&SpecAliasData>
Get spec alias data.
Sourcepub fn get_constraint(&self, id: SpecNodeId) -> Option<&ConstraintData>
pub fn get_constraint(&self, id: SpecNodeId) -> Option<&ConstraintData>
Get constraint data.
Sourcepub fn get_intent(&self, id: SpecNodeId) -> Option<&IntentData>
pub fn get_intent(&self, id: SpecNodeId) -> Option<&IntentData>
Get intent data.
Sourcepub fn all_groups(&self) -> impl Iterator<Item = (SpecNodeId, &GroupData)>
pub fn all_groups(&self) -> impl Iterator<Item = (SpecNodeId, &GroupData)>
Iterate all groups.
Sourcepub fn all_spec_aliases(
&self,
) -> impl Iterator<Item = (SpecNodeId, &SpecAliasData)>
pub fn all_spec_aliases( &self, ) -> impl Iterator<Item = (SpecNodeId, &SpecAliasData)>
Iterate all spec aliases.
Sourcepub fn group_count(&self) -> usize
pub fn group_count(&self) -> usize
Number of groups.
Sourcepub fn spec_count(&self) -> usize
pub fn spec_count(&self) -> usize
Number of spec aliases.
Sourcepub fn constraint_count(&self) -> usize
pub fn constraint_count(&self) -> usize
Number of constraints.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Total node count.
Sourcepub fn group_names(&self) -> impl Iterator<Item = &str>
pub fn group_names(&self) -> impl Iterator<Item = &str>
Get all group names. O(N groups)
Sourcepub fn specs_in_group_by_name(
&self,
name: &str,
) -> impl Iterator<Item = SpecNodeId> + '_
pub fn specs_in_group_by_name( &self, name: &str, ) -> impl Iterator<Item = SpecNodeId> + '_
Get specs in a group by name. O(1)
Sourcepub fn dependents(
&self,
spec: SpecNodeId,
) -> impl Iterator<Item = SpecNodeId> + '_
pub fn dependents( &self, spec: SpecNodeId, ) -> impl Iterator<Item = SpecNodeId> + '_
Get dependents of a spec (reverse dependencies). O(N specs)
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Total edge count.
Get related specs (bidirectional). O(1)
Sourcepub fn intents(&self, spec: SpecNodeId) -> impl Iterator<Item = SpecNodeId> + '_
pub fn intents(&self, spec: SpecNodeId) -> impl Iterator<Item = SpecNodeId> + '_
Get intents of a spec. O(1)
Sourcepub fn spec_name(&self, id: SpecNodeId) -> Option<&str>
pub fn spec_name(&self, id: SpecNodeId) -> Option<&str>
Get spec alias name (pre-resolved during build).
Sourcepub fn wrapped_type_name(&self, id: SpecNodeId) -> Option<&str>
pub fn wrapped_type_name(&self, id: SpecNodeId) -> Option<&str>
Get wrapped type name (pre-resolved during build).
Sourcepub fn spec_group_name(&self, id: SpecNodeId) -> Option<&str>
pub fn spec_group_name(&self, id: SpecNodeId) -> Option<&str>
Get group name for a spec alias.
Sourcepub fn spec_by_name(&self, name: &str) -> Option<SpecNodeId>
pub fn spec_by_name(&self, name: &str) -> Option<SpecNodeId>
Find spec by name (DoD - uses pre-resolved names). O(N specs)
Trait Implementations§
Source§impl Clone for SpecFlowGraphV2
impl Clone for SpecFlowGraphV2
Source§fn clone(&self) -> SpecFlowGraphV2
fn clone(&self) -> SpecFlowGraphV2
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SpecFlowGraphV2
impl Debug for SpecFlowGraphV2
Source§impl Default for SpecFlowGraphV2
impl Default for SpecFlowGraphV2
Source§fn default() -> SpecFlowGraphV2
fn default() -> SpecFlowGraphV2
Auto Trait Implementations§
impl Freeze for SpecFlowGraphV2
impl RefUnwindSafe for SpecFlowGraphV2
impl Send for SpecFlowGraphV2
impl Sync for SpecFlowGraphV2
impl Unpin for SpecFlowGraphV2
impl UnsafeUnpin for SpecFlowGraphV2
impl UnwindSafe for SpecFlowGraphV2
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more