pub trait ItemView {
// Required methods
fn as_text(&self) -> Option<&str>;
fn as_reasoning(&self) -> Option<&str>;
fn as_refusal(&self) -> Option<&str>;
fn as_tool_call(&self) -> Option<ToolCallItemView<'_>>;
fn as_tool_result(&self) -> Option<ToolResultItemView<'_>>;
}Expand description
Read-only view of a single item within a committed turn.
Implementations should return Some for exactly one accessor that matches
the item’s kind, and None for all others.
Required Methods§
Sourcefn as_reasoning(&self) -> Option<&str>
fn as_reasoning(&self) -> Option<&str>
Returns reasoning text, if this is a reasoning item.
Sourcefn as_refusal(&self) -> Option<&str>
fn as_refusal(&self) -> Option<&str>
Returns refusal text, if this is a refusal item.
Sourcefn as_tool_call(&self) -> Option<ToolCallItemView<'_>>
fn as_tool_call(&self) -> Option<ToolCallItemView<'_>>
Returns tool-call details, if this is a tool-call item.
Sourcefn as_tool_result(&self) -> Option<ToolResultItemView<'_>>
fn as_tool_result(&self) -> Option<ToolResultItemView<'_>>
Returns tool-result details, if this is a tool-result item.