pub enum Parser {
ClaudeJson,
TextTail,
Fields {
summary: String,
cost: String,
error: Option<String>,
},
}Expand description
How a worker’s output is read back.
Variants§
ClaudeJson
A {"type":"result", ...} line, the last that claude -p --output-format json or stream-json writes: success, error flag
and total_cost_usd.
TextTail
No structured output. The exit status decides, the last lines are the summary, and the cost is unknown rather than zero.
Fields
The last JSON value in the output, read by dotted field paths:
json:<summary>:<cost> or json:<summary>:<cost>:<error-flag>. A path
that resolves to nothing leaves its value unknown, and the exit status
decides unless an error flag says otherwise.
A worker whose output shape nothing else reads is then a record rather than another variant here.
Implementations§
Trait Implementations§
impl Eq for Parser
impl StructuralPartialEq for Parser
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnsafeUnpin for Parser
impl UnwindSafe for Parser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.