#[non_exhaustive]pub enum MiddlewareError {
Unauthenticated(String),
HttpChallenge {
status: u16,
www_authenticate: String,
},
Forbidden(String),
Internal(String),
}Expand description
Middleware errors produce HTTP responses directly via the Tower layer. These never become A2aError variants or JSON-RPC error objects.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Unauthenticated(String)
401 — no credentials or invalid credentials.
HttpChallenge
401 with WWW-Authenticate challenge header.
Forbidden(String)
403 — credentials valid but insufficient permissions.
Internal(String)
500 — internal middleware failure (fatal, short-circuits AnyOf).
Implementations§
Source§impl MiddlewareError
impl MiddlewareError
pub fn http_status(&self) -> u16
Trait Implementations§
Source§impl Clone for MiddlewareError
impl Clone for MiddlewareError
Source§fn clone(&self) -> MiddlewareError
fn clone(&self) -> MiddlewareError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MiddlewareError
impl RefUnwindSafe for MiddlewareError
impl Send for MiddlewareError
impl Sync for MiddlewareError
impl Unpin for MiddlewareError
impl UnsafeUnpin for MiddlewareError
impl UnwindSafe for MiddlewareError
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