tag
Generic
tag and untag actions for any Taggable entity.fn tag
pub async fn tag<E: Taggable>(
context: &AppContext,
raw_id: &str,
label: &str,
output: &json::Flags,
) -> Result<(), Error>Attach a tag label to the entity identified by raw_id.
| Parameter | Type | Description |
|---|---|---|
context |
&AppContext | the application context: settings, store and current project |
raw_id |
&str | the entity’s ID or a unique prefix of it |
label |
&str | the tag to attach |
output |
&json::Flags | the output mode: normal, --json, --quiet or --raw |
| returns | Result<(), Error> | Ok(()) once the tag is attached and the entity printed, or the error that stopped it. |
fn untag
pub async fn untag<E: Taggable>(
context: &AppContext,
raw_id: &str,
label: &str,
output: &json::Flags,
) -> Result<(), Error>Detach a tag label from the entity identified by raw_id.
| Parameter | Type | Description |
|---|---|---|
context |
&AppContext | the application context: settings, store and current project |
raw_id |
&str | the entity’s ID or a unique prefix of it |
label |
&str | the tag to detach |
output |
&json::Flags | the output mode: normal, --json, --quiet or --raw |
| returns | Result<(), Error> | Ok(()) once the tag is detached and the entity printed, or the error that stopped it. |