pub struct ToolResultBlock {
pub tool_name: String,
pub status: Status,
pub content: Vec<u8>,
pub schema_hint: Option<String>,
}Expand description
TOOL_RESULT block — represents output from a tool or MCP server.
Captures the name of the tool that was invoked, its execution status, the raw output, and an optional schema hint so downstream consumers know how to parse the content.
Field layout within body:
┌──────────┬───────────┬─────────────┬──────────────────────────┐
│ Field ID │ Wire Type │ Name │ Description │
├──────────┼───────────┼─────────────┼──────────────────────────┤
│ 1 │ Bytes │ tool_name │ Tool identifier │
│ 2 │ Varint │ status │ Status enum byte │
│ 3 │ Bytes │ content │ Tool output bytes │
│ 4 │ Bytes │ schema_hint │ Schema hint (optional) │
└──────────┴───────────┴─────────────┴──────────────────────────┘Fields§
§tool_name: String§status: Status§content: Vec<u8>§schema_hint: Option<String>Optional schema hint (e.g. “json-schema://…”) to help consumers parse the content field.
Implementations§
Source§impl ToolResultBlock
impl ToolResultBlock
Sourcepub fn encode_body(&self) -> Vec<u8> ⓘ
pub fn encode_body(&self) -> Vec<u8> ⓘ
Serialize this block’s fields into a TLV-encoded body.
Sourcepub fn decode_body(buf: &[u8]) -> Result<Self, TypeError>
pub fn decode_body(buf: &[u8]) -> Result<Self, TypeError>
Deserialize a TOOL_RESULT block from a TLV-encoded body.
Trait Implementations§
Source§impl Clone for ToolResultBlock
impl Clone for ToolResultBlock
Source§fn clone(&self) -> ToolResultBlock
fn clone(&self) -> ToolResultBlock
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToolResultBlock
impl Debug for ToolResultBlock
Source§impl PartialEq for ToolResultBlock
impl PartialEq for ToolResultBlock
impl Eq for ToolResultBlock
impl StructuralPartialEq for ToolResultBlock
Auto Trait Implementations§
impl Freeze for ToolResultBlock
impl RefUnwindSafe for ToolResultBlock
impl Send for ToolResultBlock
impl Sync for ToolResultBlock
impl Unpin for ToolResultBlock
impl UnsafeUnpin for ToolResultBlock
impl UnwindSafe for ToolResultBlock
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