pub struct RouteConfig {
pub accepts: Vec<PaymentOption>,
pub resource: Option<String>,
pub description: Option<String>,
pub mime_type: Option<String>,
}Expand description
Configuration for a payment-protected route.
Specifies which payment options a route accepts, along with optional metadata for resource description and paywall customisation.
Corresponds to Python SDK’s RouteConfig.
Fields§
§accepts: Vec<PaymentOption>Accepted payment options for this route.
resource: Option<String>Override resource URL (defaults to request URL).
description: Option<String>Human-readable description of the resource.
mime_type: Option<String>MIME type of the resource.
Implementations§
Source§impl RouteConfig
impl RouteConfig
Sourcepub fn single(option: PaymentOption) -> Self
pub fn single(option: PaymentOption) -> Self
Creates a new route config with a single payment option.
Sourcepub fn multi(options: Vec<PaymentOption>) -> Self
pub fn multi(options: Vec<PaymentOption>) -> Self
Creates a new route config with multiple payment options.
Sourcepub fn with_resource(self, resource: impl Into<String>) -> Self
pub fn with_resource(self, resource: impl Into<String>) -> Self
Sets the resource URL override.
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Sets the resource description.
Sourcepub fn with_mime_type(self, mime: impl Into<String>) -> Self
pub fn with_mime_type(self, mime: impl Into<String>) -> Self
Sets the MIME type.
Trait Implementations§
Source§impl Clone for RouteConfig
impl Clone for RouteConfig
Source§fn clone(&self) -> RouteConfig
fn clone(&self) -> RouteConfig
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 RouteConfig
impl RefUnwindSafe for RouteConfig
impl Send for RouteConfig
impl Sync for RouteConfig
impl Unpin for RouteConfig
impl UnwindSafe for RouteConfig
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