pub trait BoxCodec {
type Box: Clone;
// Required methods
fn tool_call_box(&mut self, call: &ToolCall) -> Self::Box;
fn box_text<'a>(&self, box_: &'a Self::Box) -> &'a str;
// Provided method
fn malformed_tool_call_message(
&self,
_box_: &Self::Box,
) -> Option<&'static str> { ... }
}Expand description
Converts between K1’s canonical box type and text visible to Codex.
Required Associated Types§
Required Methods§
Sourcefn tool_call_box(&mut self, call: &ToolCall) -> Self::Box
fn tool_call_box(&mut self, call: &ToolCall) -> Self::Box
Converts one typed Codex dynamic-tool request into a canonical box.
A shim invokes this exactly once for each call it receives.
Provided Methods§
Sourcefn malformed_tool_call_message(&self, _box_: &Self::Box) -> Option<&'static str>
fn malformed_tool_call_message(&self, _box_: &Self::Box) -> Option<&'static str>
Returns a safe validation message when a converted call box is malformed.
The message must be fixed, safely displayable text supplied by the codec;
it must not be derived from raw arbitrary tool-call values. A malformed
box is answered unsuccessfully and is never passed to the launcher.
Existing codecs retain their prior behavior through the None default.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".