pub struct TimeoutMiddleware { /* private fields */ }Expand description
Enforces a per-call time limit on LLM completion requests.
Returns PeError::Timeout if the inner call exceeds the configured duration.
Implementations§
Trait Implementations§
Source§impl ProviderMiddleware for TimeoutMiddleware
impl ProviderMiddleware for TimeoutMiddleware
Source§fn wrap_complete<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
tools: &'life2 [ToolSchema],
next: &'life3 dyn LlmProvider,
) -> Pin<Box<dyn Future<Output = Result<LlmResponse, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn wrap_complete<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
tools: &'life2 [ToolSchema],
next: &'life3 dyn LlmProvider,
) -> Pin<Box<dyn Future<Output = Result<LlmResponse, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Wrap a completion call. Call
next.complete(messages, tools).await
to forward to the next layer (or the base provider).Auto Trait Implementations§
impl Freeze for TimeoutMiddleware
impl RefUnwindSafe for TimeoutMiddleware
impl Send for TimeoutMiddleware
impl Sync for TimeoutMiddleware
impl Unpin for TimeoutMiddleware
impl UnsafeUnpin for TimeoutMiddleware
impl UnwindSafe for TimeoutMiddleware
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