Skip to main content

SpecFlowGraphV2

Struct SpecFlowGraphV2 

Source
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

Source

pub fn new() -> Self

Create a new empty graph.

Source

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.

Source

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.

Source

pub fn add_constraint(&mut self, kind: ConstraintKind) -> SpecNodeId

Add a constraint.

Source

pub fn add_intent( &mut self, description: impl Into<String>, kind: IntentKind, ) -> SpecNodeId

Add an intent.

Source

pub fn add_dependency(&mut self, from: SpecNodeId, to: SpecNodeId)

Add dependency: from depends on to.

Add related edge (bidirectional).

Link constraint to spec.

Link intent to spec.

Source

pub fn group_by_name(&self, name: &str) -> Option<SpecNodeId>

Get group by name. O(1)

Source

pub fn spec_by_symbol(&self, id: SymbolId) -> Option<SpecNodeId>

Get spec by SymbolId. O(1)

Source

pub fn specs_in_group( &self, group: SpecNodeId, ) -> impl Iterator<Item = SpecNodeId> + '_

Get all specs in a group. O(1)

Source

pub fn dependencies( &self, spec: SpecNodeId, ) -> impl Iterator<Item = SpecNodeId> + '_

Get dependencies of a spec. O(1)

Source

pub fn constraints( &self, spec: SpecNodeId, ) -> impl Iterator<Item = SpecNodeId> + '_

Get constraints of a spec. O(1)

Source

pub fn get_group(&self, id: SpecNodeId) -> Option<&GroupData>

Get group data.

Source

pub fn get_spec_alias(&self, id: SpecNodeId) -> Option<&SpecAliasData>

Get spec alias data.

Source

pub fn get_constraint(&self, id: SpecNodeId) -> Option<&ConstraintData>

Get constraint data.

Source

pub fn get_intent(&self, id: SpecNodeId) -> Option<&IntentData>

Get intent data.

Source

pub fn all_groups(&self) -> impl Iterator<Item = (SpecNodeId, &GroupData)>

Iterate all groups.

Source

pub fn all_spec_aliases( &self, ) -> impl Iterator<Item = (SpecNodeId, &SpecAliasData)>

Iterate all spec aliases.

Source

pub fn group_count(&self) -> usize

Number of groups.

Source

pub fn spec_count(&self) -> usize

Number of spec aliases.

Source

pub fn constraint_count(&self) -> usize

Number of constraints.

Source

pub fn node_count(&self) -> usize

Total node count.

Source

pub fn is_empty(&self) -> bool

Check if empty.

Source

pub fn group_names(&self) -> impl Iterator<Item = &str>

Get all group names. O(N groups)

Source

pub fn specs_in_group_by_name( &self, name: &str, ) -> impl Iterator<Item = SpecNodeId> + '_

Get specs in a group by name. O(1)

Source

pub fn dependents( &self, spec: SpecNodeId, ) -> impl Iterator<Item = SpecNodeId> + '_

Get dependents of a spec (reverse dependencies). O(N specs)

Source

pub fn edge_count(&self) -> usize

Total edge count.

Source

pub fn related(&self, spec: SpecNodeId) -> impl Iterator<Item = SpecNodeId> + '_

Get related specs (bidirectional). O(1)

Source

pub fn intents(&self, spec: SpecNodeId) -> impl Iterator<Item = SpecNodeId> + '_

Get intents of a spec. O(1)

Source

pub fn spec_name(&self, id: SpecNodeId) -> Option<&str>

Get spec alias name (pre-resolved during build).

Source

pub fn wrapped_type_name(&self, id: SpecNodeId) -> Option<&str>

Get wrapped type name (pre-resolved during build).

Source

pub fn spec_group_name(&self, id: SpecNodeId) -> Option<&str>

Get group name for a spec alias.

Source

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

Source§

fn clone(&self) -> SpecFlowGraphV2

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SpecFlowGraphV2

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SpecFlowGraphV2

Source§

fn default() -> SpecFlowGraphV2

Returns the “default value” for a type. Read more
Source§

impl Serialize for SpecFlowGraphV2

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.