Struct WorkflowStrings

Source
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

Source

pub fn alloc_for_traversal(&mut self)

Allocate space for new strings created during traversal:

Source

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.

Source

pub fn get_full_branch_str(&self, branch: &BranchSpec) -> Result<Ref<'_, str>>

Get user-friendly branch str, w/ all branches shown.

Source

pub fn get_real_task_str(&self, task: &RealTaskKey) -> Result<Ref<'_, str>>

Get user-friendly task str, e.g. ‘task_name[full_branch_str]’.

Source

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.

Source

pub fn create_value(&mut self, lhs: Ident<'_>, rhs: Rhs<'_>) -> Result<Value>

Create a value from its ast representation.

Source

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.

Source

pub fn add_branchpoint(&mut self, branchpoint: &str) -> Result<BranchpointId>

Add a new branchpoint to the mapping:

Source

pub fn add_branch( &mut self, _branchpoint: BranchpointId, branch_name: &str, ) -> Result<IdentId>

Add a new branch name for the given branchpoint:

Source

pub fn log_sizes(&self)

Log sizes of interners at debug level:

Source§

impl WorkflowStrings

Source

pub fn make_interpolated( &self, orig: LiteralId, vars: &[(IdentId, LiteralId)], buf: &mut String, ) -> Result<()>

Realize an interpolated string into buf.

Trait Implementations§

Source§

impl Debug for WorkflowStrings

Source§

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

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

impl Default for WorkflowStrings

Source§

fn default() -> Self

Returns the “default value” for a type. 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> 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, 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.