indicators

Inline blocked/blocking relationship indicators molecule for task rows.

struct Component

source

pub struct Component<'a>

Renders inline blocked/blocking status indicators for a task.

Field Type Description
blocked_by Vec<&'a str> IDs of the tasks that block this one; each gets a blocked-by <id> part.
is_blocking bool Whether to show the ! blocking part first.
prefix_len usize Highlighted prefix length for each blocker ID.

Implements Display.

Component::new

source

pub fn new() -> Self

Create an empty indicators block with no blocking relationships set.

Parameter Type Description
returns Self Indicators that display as an empty string, with a 2-character ID prefix.

Component::blocked_by

source

pub fn blocked_by(self, ids: Vec<&'a str>) -> Self

Sets the IDs of tasks blocking this one.

Parameter Type Description
ids Vec<&'a str> the blocker IDs, shown in this order
returns Self The indicators with the blockers replaced.

Component::blocking

source

pub fn blocking(self, v: bool) -> Self

Marks this task as blocking other tasks.

Parameter Type Description
v bool whether the task blocks others
returns Self The indicators with the flag set.

Component::prefix_len

source

pub fn prefix_len(self, len: usize) -> Self

Set the highlighted prefix length passed to rendered Ids.

Parameter Type Description
len usize the number of highlighted characters in each ID
returns Self The indicators with the new prefix length.