pub struct CallBatcher { /* private fields */ }Implementations§
Source§impl CallBatcher
impl CallBatcher
pub fn new() -> Self
Sourcepub fn enqueue(&mut self, tool: impl Into<String>, args: Value) -> usize
pub fn enqueue(&mut self, tool: impl Into<String>, args: Value) -> usize
Add a call to the queue. Returns its id.
pub fn enqueue_with_priority( &mut self, tool: impl Into<String>, args: Value, priority: i32, ) -> usize
Sourcepub fn flush(&mut self) -> Vec<PendingCall>
pub fn flush(&mut self) -> Vec<PendingCall>
Remove and return all queued calls (in enqueue order).
Sourcepub fn flush_by_priority(&mut self) -> Vec<PendingCall>
pub fn flush_by_priority(&mut self) -> Vec<PendingCall>
Remove and return calls sorted by priority descending.
Sourcepub fn peek(&self) -> &[PendingCall]
pub fn peek(&self) -> &[PendingCall]
Peek at calls without removing them.
Sourcepub fn calls_for(&self, tool: &str) -> Vec<&PendingCall>
pub fn calls_for(&self, tool: &str) -> Vec<&PendingCall>
Calls for a specific tool (peeked, not removed).
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn clear(&mut self)
Sourcepub fn to_tool_use_blocks(&self) -> Vec<Value>
pub fn to_tool_use_blocks(&self) -> Vec<Value>
Build Anthropic-style tool_use content blocks.
Trait Implementations§
Source§impl Debug for CallBatcher
impl Debug for CallBatcher
Source§impl Default for CallBatcher
impl Default for CallBatcher
Source§fn default() -> CallBatcher
fn default() -> CallBatcher
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CallBatcher
impl RefUnwindSafe for CallBatcher
impl Send for CallBatcher
impl Sync for CallBatcher
impl Unpin for CallBatcher
impl UnsafeUnpin for CallBatcher
impl UnwindSafe for CallBatcher
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