pub struct MiddlewareStack { /* private fields */ }Expand description
A validated, declaration-ordered middleware pipeline.
Registration, prompt sections, and forward hooks follow declaration order;
only Middleware::session_end unwinds in reverse. All
Middleware::pre_model hooks finish before any Middleware::model_request
hook runs. Prompt sections are composed once at agent creation; dynamic
durable state belongs in pre_model, request-only decoration in model_request.
Implementations§
Source§impl MiddlewareStack
impl MiddlewareStack
Sourcepub fn new(entries: Vec<Arc<dyn Middleware>>) -> Result<Self>
pub fn new(entries: Vec<Arc<dyn Middleware>>) -> Result<Self>
Creates a stack and rejects duplicate or incompatible middleware.
§Errors
Returns an error if configuration is invalid or a required resource cannot be initialized.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for MiddlewareStack
impl !UnwindSafe for MiddlewareStack
impl Freeze for MiddlewareStack
impl Send for MiddlewareStack
impl Sync for MiddlewareStack
impl Unpin for MiddlewareStack
impl UnsafeUnpin 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