#[non_exhaustive]pub enum ProtectedRequestOutcome {
Continue,
GrantAccess,
Abort {
status: StatusCode,
body: Option<String>,
},
}Available on crate feature
server only.Expand description
Outcome returned by PaygateHooks::on_protected_request.
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.
Continue
Continue with the standard x402 payment flow.
GrantAccess
Bypass payment and forward the request to the downstream service.
Abort
Abort with the given status code and optional body.
Fields
§
status: StatusCodeHTTP status to return.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProtectedRequestOutcome
impl RefUnwindSafe for ProtectedRequestOutcome
impl Send for ProtectedRequestOutcome
impl Sync for ProtectedRequestOutcome
impl Unpin for ProtectedRequestOutcome
impl UnsafeUnpin for ProtectedRequestOutcome
impl UnwindSafe for ProtectedRequestOutcome
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