indicators
Inline blocked/blocking relationship indicators molecule for task rows.
struct Component
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
pub fn new() -> SelfCreate 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
pub fn blocked_by(self, ids: Vec<&'a str>) -> SelfSets 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
pub fn blocking(self, v: bool) -> SelfMarks 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
pub fn prefix_len(self, len: usize) -> SelfSet 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. |