#[non_exhaustive]pub struct SupportedPaymentKind {
pub x402_version: u8,
pub scheme: CompactString,
pub network: CompactString,
pub extra: Option<Value>,
}Expand description
A single payment kind advertised by a facilitator.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.x402_version: u8x402 protocol version (2).
scheme: CompactStringScheme name ("exact", "upto", …).
network: CompactStringCAIP-2 network identifier.
extra: Option<Value>Optional scheme-specific extras (fee payer, memo, …).
Implementations§
Source§impl SupportedPaymentKind
impl SupportedPaymentKind
Sourcepub fn new(
x402_version: u8,
scheme: impl Into<CompactString>,
network: impl Into<CompactString>,
) -> Self
pub fn new( x402_version: u8, scheme: impl Into<CompactString>, network: impl Into<CompactString>, ) -> Self
Constructs a kind from the three required fields.
Sourcepub fn with_extra(self, extra: Value) -> Self
pub fn with_extra(self, extra: Value) -> Self
Attaches an extra JSON blob.
Sourcepub fn with_optional_extra(self, extra: Option<Value>) -> Self
pub fn with_optional_extra(self, extra: Option<Value>) -> Self
Attaches an optional extra blob.
Trait Implementations§
Source§impl Clone for SupportedPaymentKind
impl Clone for SupportedPaymentKind
Source§fn clone(&self) -> SupportedPaymentKind
fn clone(&self) -> SupportedPaymentKind
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 Debug for SupportedPaymentKind
impl Debug for SupportedPaymentKind
Source§impl<'de> Deserialize<'de> for SupportedPaymentKind
impl<'de> Deserialize<'de> for SupportedPaymentKind
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SupportedPaymentKind
Source§impl PartialEq for SupportedPaymentKind
impl PartialEq for SupportedPaymentKind
Source§impl Serialize for SupportedPaymentKind
impl Serialize for SupportedPaymentKind
impl StructuralPartialEq for SupportedPaymentKind
Auto Trait Implementations§
impl Freeze for SupportedPaymentKind
impl RefUnwindSafe for SupportedPaymentKind
impl Send for SupportedPaymentKind
impl Sync for SupportedPaymentKind
impl Unpin for SupportedPaymentKind
impl UnsafeUnpin for SupportedPaymentKind
impl UnwindSafe for SupportedPaymentKind
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