WorkflowLike

Trait WorkflowLike 

Source
pub trait WorkflowLike:
    Send
    + Sync
    + Debug
    + 'static {
Show 15 methods // Required methods fn locator(&self) -> Arc<Reference>; fn path(&self) -> Arc<PathBuf>; fn date(&self) -> DateTime; fn version(&self) -> u32; fn minor_version(&self) -> u32; fn get_index(&self, identifier: &str) -> Option<usize>; fn get_row(&self, index: usize) -> Row; fn get_rule(&self, identifier: &str) -> Option<Arc<Rule>>; fn contains(&self, identifier: &str) -> bool; fn has_rule(&self, index: usize) -> bool; fn rule_count(&self) -> usize; fn row_count(&self) -> usize; fn iter_rows<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Row> + 'a>; fn iter_rules(&self) -> Box<dyn Iterator<Item = Arc<Rule>> + '_>; fn as_any(&self) -> &dyn Any;
}
Expand description

Thread-safe abstraction over workflow rule storage and metadata.

Implemented by concrete workflow containers such as Workflow.

Required Methods§

Source

fn locator(&self) -> Arc<Reference>

Returns the global locator (Reference) for this workflow.

The locator uniquely identifies the workflow within the workspace.

Source

fn path(&self) -> Arc<PathBuf>

Returns the file system path to the workflow’s AIM file.

This path points to the .aim file that stores the workflow content.

Source

fn date(&self) -> DateTime

Source

fn version(&self) -> u32

Returns the major version (epoch) of the workflow.

The epoch represents major structural changes to the workflow. Increments when significant changes are made that require a new version.

Source

fn minor_version(&self) -> u32

Returns the minor version (partial) of the workflow.

The partial represents incremental updates within the same epoch. Increments for minor changes that don’t require a new major version.

Source

fn get_index(&self, identifier: &str) -> Option<usize>

Gets the row index of a rule by identifier.

§Parameters
  • identifier - The rule identifier
§Returns

Some(usize) if the rule exists, None otherwise.

Source

fn get_row(&self, index: usize) -> Row

Retrieves a rule by its row index.

§Parameters
  • index: The zero-based row index
§Returns

Some(Rule) if the index is valid and contains a rule, None otherwise

Source

fn get_rule(&self, identifier: &str) -> Option<Arc<Rule>>

Retrieves a rule by its identifier.

§Parameters
  • identifier: The rule’s unique identifier
§Returns

Some(Rule) if the identifier exists, None otherwise

Source

fn contains(&self, identifier: &str) -> bool

Checks if a rule with the given identifier exists.

§Parameters
  • identifier: The identifier to check
§Returns

true if the rule exists, false otherwise

Source

fn has_rule(&self, index: usize) -> bool

Checks if a specific row index contains a rule.

§Parameters
  • index: The row index to check
§Returns

true if the row contains a rule, false if empty or out of bounds

Source

fn rule_count(&self) -> usize

Returns the number of rules in the workflow.

This counts only the actual rules, excluding empty rows.

Source

fn row_count(&self) -> usize

Returns the total number of rows in the workflow.

This includes both rules and empty rows.

Source

fn iter_rows<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Row> + 'a>

Returns an iterator over all rows.

The iterator yields &Option<Rule> items, including empty rows. Use this when you need to preserve the exact row structure.

Source

fn iter_rules(&self) -> Box<dyn Iterator<Item = Arc<Rule>> + '_>

Returns an iterator over all rules.

The iterator yields &Rule items, skipping empty rows. Use this when you only need the actual rules.

Source

fn as_any(&self) -> &dyn Any

Returns a reference to the workflow as a trait object.

This method enables downcasting to the concrete workflow type when working with trait objects.

Implementors§