pub struct Shim<C: BoxCodec> { /* private fields */ }Expand description
A single-owner, per-conversation bridge between K1 boxes and Codex turns.
Invoke a shim sequentially. Different shims may share cloned Adapters.
Implementations§
Source§impl<C: BoxCodec> Shim<C>
impl<C: BoxCodec> Shim<C>
Sourcepub fn new(
adapter: Adapter,
conversation_key: impl Into<String>,
codec: C,
launcher: Box<dyn ToolCallLauncher<C::Box>>,
) -> Self
pub fn new( adapter: Adapter, conversation_key: impl Into<String>, codec: C, launcher: Box<dyn ToolCallLauncher<C::Box>>, ) -> Self
Creates a ready shim for one conversation.
Sourcepub fn record_box(&mut self, box_: C::Box)
pub fn record_box(&mut self, box_: C::Box)
Appends one externally produced box in canonical history order.
Sourcepub fn record_boxes(&mut self, boxes: impl IntoIterator<Item = C::Box>)
pub fn record_boxes(&mut self, boxes: impl IntoIterator<Item = C::Box>)
Appends externally produced boxes without changing their order.
Sourcepub fn pending_box_count(&self) -> usize
pub fn pending_box_count(&self) -> usize
Returns the number of boxes waiting for the next fresh native turn.
Sourcepub async fn close_conversation(&mut self) -> Result<(), Error>
pub async fn close_conversation(&mut self) -> Result<(), Error>
Closes this shim’s runtime conversation while the shim is ready.
Pending external boxes are retained and can prefix a later fresh thread.
Auto Trait Implementations§
impl<C> !RefUnwindSafe for Shim<C>
impl<C> !Sync for Shim<C>
impl<C> !UnwindSafe for Shim<C>
impl<C> Freeze for Shim<C>
impl<C> Send for Shim<C>
impl<C> Unpin for Shim<C>
impl<C> UnsafeUnpin for Shim<C>where
C: UnsafeUnpin,
Box<dyn ToolCallLauncher<<C as BoxCodec>::Box>>: UnsafeUnpin,
VecDeque<<C as BoxCodec>::Box>: UnsafeUnpin,
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