pub struct MiddlewareStack { /* private fields */ }Expand description
Convenience container — registered middlewares + helpers to run them.
Implementations§
Source§impl MiddlewareStack
impl MiddlewareStack
pub fn new() -> Self
pub fn push(self, m: Arc<dyn AgentMiddleware>) -> Self
pub fn iter(&self) -> impl Iterator<Item = &Arc<dyn AgentMiddleware>>
pub fn iter_rev(&self) -> impl Iterator<Item = &Arc<dyn AgentMiddleware>>
pub async fn run_before_agent( &self, agent_id: &AgentId, user: &str, ) -> Result<()>
pub async fn run_before_model_call( &self, batch: &mut ExecuteBatch, ) -> Result<()>
pub async fn run_after_model_call(&self, result: &mut TurnResult) -> Result<()>
pub async fn run_before_tool_call( &self, name: &str, args: &mut Value, ) -> Result<()>
pub async fn run_after_tool_call( &self, name: &str, result: &mut Result<Value>, ) -> Result<()>
pub async fn run_after_agent(&self, result: &mut TurnResult) -> Result<()>
pub async fn run_dynamic_prompt( &self, agent_id: &AgentId, user: &str, ) -> Result<Option<String>>
Trait Implementations§
Source§impl Clone for MiddlewareStack
impl Clone for MiddlewareStack
Source§fn clone(&self) -> MiddlewareStack
fn clone(&self) -> MiddlewareStack
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 moreSource§impl Default for MiddlewareStack
impl Default for MiddlewareStack
Source§fn default() -> MiddlewareStack
fn default() -> MiddlewareStack
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MiddlewareStack
impl !RefUnwindSafe for MiddlewareStack
impl Send for MiddlewareStack
impl Sync for MiddlewareStack
impl Unpin for MiddlewareStack
impl UnsafeUnpin for MiddlewareStack
impl !UnwindSafe for MiddlewareStack
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