#[non_exhaustive]pub enum VerifyResponse {
Valid {
payer: CompactString,
extensions: Extensions,
},
Invalid {
reason: ErrorReason,
message: Option<CompactString>,
payer: Option<CompactString>,
extensions: Extensions,
},
}Expand description
Verification outcome returned by a facilitator.
Serialised as a flat boolean-discriminated JSON object (matching the x402 wire format). Consumers get a safe, pattern-matchable Rust enum.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Valid
Payload passed all verification checks.
Fields
payer: CompactStringAddress of the verified payer.
extensions: ExtensionsFacilitator-attached extension data.
Invalid
Payload was well-formed but failed verification.
Fields
reason: ErrorReasonWire-level reason code.
message: Option<CompactString>Optional human-readable message.
payer: Option<CompactString>Optional payer address if identifiable from the payload.
extensions: ExtensionsFacilitator-attached extension data.
Implementations§
Source§impl VerifyResponse
impl VerifyResponse
Sourcepub fn valid(payer: impl Into<CompactString>) -> Self
pub fn valid(payer: impl Into<CompactString>) -> Self
Convenience: constructs a Valid response with no extensions.
Sourcepub fn invalid(payer: Option<CompactString>, reason: ErrorReason) -> Self
pub fn invalid(payer: Option<CompactString>, reason: ErrorReason) -> Self
Convenience: constructs an Invalid response without a human message.
Sourcepub fn invalid_with_message(
payer: Option<CompactString>,
reason: ErrorReason,
message: impl Into<CompactString>,
) -> Self
pub fn invalid_with_message( payer: Option<CompactString>, reason: ErrorReason, message: impl Into<CompactString>, ) -> Self
Convenience: constructs an Invalid response with a message.
Sourcepub fn from_facilitator_error(error: &FacilitatorError) -> Self
pub fn from_facilitator_error(error: &FacilitatorError) -> Self
Converts a FacilitatorError into an Invalid response for the
HTTP boundary, preserving the structured reason code.
Trait Implementations§
Source§impl Clone for VerifyResponse
impl Clone for VerifyResponse
Source§fn clone(&self) -> VerifyResponse
fn clone(&self) -> VerifyResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VerifyResponse
impl Debug for VerifyResponse
Source§impl<'de> Deserialize<'de> for VerifyResponse
impl<'de> Deserialize<'de> for VerifyResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for VerifyResponse
Source§impl PartialEq for VerifyResponse
impl PartialEq for VerifyResponse
Source§impl Serialize for VerifyResponse
impl Serialize for VerifyResponse
impl StructuralPartialEq for VerifyResponse
Auto Trait Implementations§
impl Freeze for VerifyResponse
impl RefUnwindSafe for VerifyResponse
impl Send for VerifyResponse
impl Sync for VerifyResponse
impl Unpin for VerifyResponse
impl UnsafeUnpin for VerifyResponse
impl UnwindSafe for VerifyResponse
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.