pub struct PaymentWrapperConfig {
pub accepts: Vec<PaymentRequirements>,
pub resource: Option<ResourceInfo>,
pub hooks: PaymentWrapperHooks,
pub extensions: Extensions,
}Available on crate feature
server only.Expand description
Go PaymentWrapperConfig.
Fields§
§accepts: Vec<PaymentRequirements>Advertised payment options.
resource: Option<ResourceInfo>Resource metadata (defaulted if None at use sites).
hooks: PaymentWrapperHooksOptional lifecycle hooks.
extensions: ExtensionsExtensions included on payment-required responses.
Implementations§
Source§impl PaymentWrapperConfig
impl PaymentWrapperConfig
Sourcepub fn try_new(
accepts: Vec<PaymentRequirements>,
resource: Option<ResourceInfo>,
) -> Result<Self, PaymentWrapperConfigError>
pub fn try_new( accepts: Vec<PaymentRequirements>, resource: Option<ResourceInfo>, ) -> Result<Self, PaymentWrapperConfigError>
Builds config; returns error if accepts is empty.
§Errors
PaymentWrapperConfigError::EmptyAccepts when accepts is empty.
Sourcepub fn with_hooks(self, hooks: PaymentWrapperHooks) -> Self
pub fn with_hooks(self, hooks: PaymentWrapperHooks) -> Self
Attaches hooks.
Sourcepub fn with_extensions(self, extensions: Extensions) -> Self
pub fn with_extensions(self, extensions: Extensions) -> Self
Attaches extensions for payment-required responses.
Trait Implementations§
Source§impl Clone for PaymentWrapperConfig
impl Clone for PaymentWrapperConfig
Source§fn clone(&self) -> PaymentWrapperConfig
fn clone(&self) -> PaymentWrapperConfig
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for PaymentWrapperConfig
impl !UnwindSafe for PaymentWrapperConfig
impl Freeze for PaymentWrapperConfig
impl Send for PaymentWrapperConfig
impl Sync for PaymentWrapperConfig
impl Unpin for PaymentWrapperConfig
impl UnsafeUnpin for PaymentWrapperConfig
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