artifact!() { /* proc-macro */ }Expand description
Writes an artifact value via the Output on Context
Expands to context.output().artifact(...).await.expect("event channel closed"), where
context resolves to the local variable in the calling function’s scope. Unlike message!
and detail!, this macro does not use format! — it takes an expression that implements
Display, Serialize, and Debug. This is the macro equivalent of Output::artifact.
The macro must be called from an async function because the core Output methods are async.
§Examples
ⓘ
use clawless::prelude::*;
#[command]
pub async fn count(args: CountArgs, context: Context) -> CommandResult {
let count = WordCount { words: 42 };
artifact!(count);
Ok(())
}