pub struct WorkflowStrings {
pub branchpoints: TypedInterner<BranchpointId, PackedInterner<u8, u8>>,
pub tasks: TypedInterner<AbstractTaskId, PackedInterner<u8, u16>>,
pub idents: TypedInterner<IdentId, PackedInterner<u16, u16>>,
pub modules: TypedInterner<ModuleId, PackedInterner<u8, u8>>,
pub literals: TypedInterner<LiteralId, LooseInterner<u8, u16>>,
pub baselines: BaselineBranches,
pub run: TypedInterner<RunStrId, PackedInterner<u32, usize>>,
/* private fields */
}
Expand description
Stores all the interned strings associated with a Workflow.
Fields§
§branchpoints: TypedInterner<BranchpointId, PackedInterner<u8, u8>>
Names of branchpoints
tasks: TypedInterner<AbstractTaskId, PackedInterner<u8, u16>>
Names of tasks
idents: TypedInterner<IdentId, PackedInterner<u16, u16>>
Names of other idents (variables, branches, etc.)
modules: TypedInterner<ModuleId, PackedInterner<u8, u8>>
Names of modules
literals: TypedInterner<LiteralId, LooseInterner<u8, u16>>
Literal strings (code blocks, variable values)
baselines: BaselineBranches
Keep track of which branch is baseline for each branchpoint
run: TypedInterner<RunStrId, PackedInterner<u32, usize>>
Strings used while running workflow: full file paths, debug strings etc.
Implementations§
Source§impl WorkflowStrings
impl WorkflowStrings
Sourcepub fn alloc_for_traversal(&mut self)
pub fn alloc_for_traversal(&mut self)
Allocate space for new strings created during traversal:
Sourcepub fn alloc_for_run(&mut self)
pub fn alloc_for_run(&mut self)
Since we don’t allocate any space for runtime strings up front, call this fn to get ready to actually run the workflow.
Sourcepub fn get_full_branch_str(&self, branch: &BranchSpec) -> Result<Ref<'_, str>>
pub fn get_full_branch_str(&self, branch: &BranchSpec) -> Result<Ref<'_, str>>
Get user-friendly branch str, w/ all branches shown.
Sourcepub fn get_real_task_str(&self, task: &RealTaskKey) -> Result<Ref<'_, str>>
pub fn get_real_task_str(&self, task: &RealTaskKey) -> Result<Ref<'_, str>>
Get user-friendly task str, e.g. ‘task_name[full_branch_str]’.
Sourcepub fn make_compact_branch_string(
&self,
branch: &BranchSpec,
buf: &mut String,
) -> Result<()>
pub fn make_compact_branch_string( &self, branch: &BranchSpec, buf: &mut String, ) -> Result<()>
Get user-friendly branch str, w/ ‘Baseline.baseline’ for baseline branches. Since this string will not change when new branchpoints are added, it is suitable for filenames that need to be consistent between runs.
Sourcepub fn create_value(&mut self, lhs: Ident<'_>, rhs: Rhs<'_>) -> Result<Value>
pub fn create_value(&mut self, lhs: Ident<'_>, rhs: Rhs<'_>) -> Result<Value>
Create a value from its ast representation.
Sourcepub fn pre_load_baseline(
&mut self,
branchpoint: &str,
branchval: &str,
) -> Result<()>
pub fn pre_load_baseline( &mut self, branchpoint: &str, branchval: &str, ) -> Result<()>
Used while loading branchpoints.txt to make sure our branchpoints are ordered consistently, and baselines stay consistent between runs.
Sourcepub fn add_branchpoint(&mut self, branchpoint: &str) -> Result<BranchpointId>
pub fn add_branchpoint(&mut self, branchpoint: &str) -> Result<BranchpointId>
Add a new branchpoint to the mapping:
Sourcepub fn add_branch(
&mut self,
_branchpoint: BranchpointId,
branch_name: &str,
) -> Result<IdentId>
pub fn add_branch( &mut self, _branchpoint: BranchpointId, branch_name: &str, ) -> Result<IdentId>
Add a new branch name for the given branchpoint: