pub enum ReplayStrategy {
Fifo,
ByToolName,
}Expand description
回放策略:决定并发/乱序场景下一条请求取哪条录播。
Variants§
Fifo
并发 FIFO:按录制顺序弹出,原子 pop 无 UB,但“哪条请求拿到哪条响应“不确定。
适合串行/顺序稳定的链;并行场景配顺序无关断言(只断言回放全部耗尽、 各响应结构非空),不断言“第 N 条是工具 A 的响应“。
ByToolName
按工具名路由:绑定工具时携带名字(bind_tools),回放时从队列里挑
工具名匹配的第一条录播(请求侧 exchange.tools 或响应侧 tool_calls)。
覆盖“不同工具响应不同、需要精确对应“的并行场景——每个并行分支各绑 各的工具,拿到各自正确的响应。比“整段消息签名匹配“弱但可复现。
Trait Implementations§
Source§impl Clone for ReplayStrategy
impl Clone for ReplayStrategy
Source§fn clone(&self) -> ReplayStrategy
fn clone(&self) -> ReplayStrategy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ReplayStrategy
Source§impl Debug for ReplayStrategy
impl Debug for ReplayStrategy
Source§impl Default for ReplayStrategy
impl Default for ReplayStrategy
Source§fn default() -> ReplayStrategy
fn default() -> ReplayStrategy
Returns the “default value” for a type. Read more
impl Eq for ReplayStrategy
Source§impl PartialEq for ReplayStrategy
impl PartialEq for ReplayStrategy
impl StructuralPartialEq for ReplayStrategy
Auto Trait Implementations§
impl Freeze for ReplayStrategy
impl RefUnwindSafe for ReplayStrategy
impl Send for ReplayStrategy
impl Sync for ReplayStrategy
impl Unpin for ReplayStrategy
impl UnsafeUnpin for ReplayStrategy
impl UnwindSafe for ReplayStrategy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.