### Trim start matches example
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.InvoiceLineItemId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Demonstrates removing characters from the start of a string using a slice of characters.
```rust
let x: &[_] = &['1', '2'];
assert_eq!("12foo1bar12".trim_start_matches(x), "foo1bar12");
```
--------------------------------
### Experimental trim prefix and suffix examples
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.BillingPortalConfigurationId.html?search=std%3A%3Avec
Examples for nightly-only APIs that return the string slice directly to facilitate method chaining.
```rust
#![feature(trim_prefix_suffix)]
// Prefix present - removes it
assert_eq!("foo:bar".trim_prefix("foo:"), "bar");
assert_eq!("foofoo".trim_prefix("foo"), "foo");
// Prefix absent - returns original string
assert_eq!("foo:bar".trim_prefix("bar"), "foo:bar");
// Method chaining example
assert_eq!("".trim_prefix('<').trim_suffix('>'), "https://example.com/");
```
```rust
#![feature(trim_prefix_suffix)]
// Suffix present - removes it
assert_eq!("bar:foo".trim_suffix(":foo"), "bar");
assert_eq!("foofoo".trim_suffix("foo"), "foo");
// Suffix absent - returns original string
assert_eq!("bar:foo".trim_suffix("bar"), "bar:foo");
// Method chaining example
assert_eq!("".trim_prefix('<').trim_suffix('>'), "https://example.com/");
```
--------------------------------
### HashMap Initialization
Source: https://docs.rs/async-stripe/0.41.0/stripe/type.Metadata.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Examples for creating new HashMaps with or without initial capacity.
```rust
use std::collections::HashMap;
let mut map: HashMap<&str, i32> = HashMap::new();
```
```rust
use std::collections::HashMap;
let mut map: HashMap<&str, i32> = HashMap::with_capacity(10);
```
--------------------------------
### Strip prefix and suffix examples
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.BillingPortalConfigurationId.html?search=std%3A%3Avec
Examples for removing a prefix or suffix exactly once, returning an Option.
```rust
assert_eq!("foo:bar".strip_prefix("foo:"), Some("bar"));
assert_eq!("foo:bar".strip_prefix("bar"), None);
assert_eq!("foofoo".strip_prefix("foo"), Some("foo"));
```
```rust
assert_eq!("bar:foo".strip_suffix(":foo"), Some("bar"));
assert_eq!("bar:foo".strip_suffix("bar"), None);
assert_eq!("foofoo".strip_suffix("foo"), Some("foo"));
```
--------------------------------
### Pin::new Example
Source: https://docs.rs/async-stripe/0.41.0/stripe/type.Response.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Constructing a Pin around an Unpin type.
```rust
use std::pin::Pin;
let mut val: u8 = 5;
// Since `val` doesn't care about being moved, we can safely create a "facade" `Pin`
// which will allow `val` to participate in `Pin`-bound apis without checking that
// pinning guarantees are actually upheld.
let mut pinned: Pin<&mut u8> = Pin::new(&mut val);
```
--------------------------------
### Using rsplit
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.InvoiceLineItemId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Examples showing how to split strings in reverse order using various patterns.
```rust
let v: Vec<&str> = "Mary had a little lamb".rsplit(' ').collect();
assert_eq!(v, ["lamb", "little", "a", "had", "Mary"]);
let v: Vec<&str> = "".rsplit('X').collect();
assert_eq!(v, [""]);
let v: Vec<&str> = "lionXXtigerXleopard".rsplit('X').collect();
assert_eq!(v, ["leopard", "tiger", "", "lion"]);
let v: Vec<&str> = "lion::tiger::leopard".rsplit("::").collect();
assert_eq!(v, ["leopard", "tiger", "lion"]);
```
```rust
let v: Vec<&str> = "abc1defXghi".rsplit(|c| c == '1' || c == 'X').collect();
assert_eq!(v, ["ghi", "def", "abc"]);
```
--------------------------------
### Iterating Over Keys
Source: https://docs.rs/async-stripe/0.41.0/stripe/type.Metadata.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Examples for iterating over keys in a HashMap, either by reference or by consuming the map.
```rust
use std::collections::HashMap;
let map = HashMap::from([
("a", 1),
("b", 2),
("c", 3),
]);
for key in map.keys() {
println!("{key}");
}
```
```rust
use std::collections::HashMap;
let map = HashMap::from([
("a", 1),
("b", 2),
("c", 3),
]);
let mut vec: Vec<&str> = map.into_keys().collect();
// The `IntoKeys` iterator produces keys in arbitrary order, so the
// keys must be sorted to test them against a sorted array.
vec.sort_unstable();
assert_eq!(vec, ["a", "b", "c"]);
```
--------------------------------
### SetupAttemptPaymentMethodDetailsPaypal Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.SetupAttemptPaymentMethodDetailsPaypal.html?search=std%3A%3Avec
The primary struct definition for PayPal payment method details in setup attempts.
```rust
pub struct SetupAttemptPaymentMethodDetailsPaypal {}
```
--------------------------------
### CreateSetupIntentSingleUse Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_intent/struct.CreateSetupIntentSingleUse.html?search=
The structure used to define the amount and currency for a single-use setup intent.
```rust
pub struct CreateSetupIntentSingleUse {
pub amount: i64,
pub currency: Currency,
}
```
--------------------------------
### CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
The enum definition containing the available variants for P24 setup future usage.
```rust
pub enum CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
None,
}
```
--------------------------------
### list
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_intent/struct.SetupIntent.html?search=
Returns a list of SetupIntents.
```APIDOC
## pub fn list(client: &Client, params: &ListSetupIntents<'_>) -> Response>
### Description
Returns a list of SetupIntents.
```
--------------------------------
### Retrieve match indices in strings
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.BillingPortalConfigurationId.html?search=u32+-%3E+bool
Use match_indices or rmatch_indices to get both the start index and the matched substring.
```rust
let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect();
assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]);
let v: Vec<_> = "1abcabc2".match_indices("abc").collect();
assert_eq!(v, [(1, "abc"), (4, "abc")]);
let v: Vec<_> = "ababa".match_indices("aba").collect();
assert_eq!(v, [(0, "aba")]); // only the first `aba`
```
```rust
let v: Vec<_> = "abcXXXabcYYYabc".rmatch_indices("abc").collect();
assert_eq!(v, [(12, "abc"), (6, "abc"), (0, "abc")]);
let v: Vec<_> = "1abcabc2".rmatch_indices("abc").collect();
assert_eq!(v, [(4, "abc"), (1, "abc")]);
let v: Vec<_> = "ababa".rmatch_indices("aba").collect();
assert_eq!(v, [(2, "aba")]); // only the last `aba`
```
--------------------------------
### create
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_intent/struct.SetupIntent.html?search=
Creates a SetupIntent object.
```APIDOC
## pub fn create(client: &Client, params: CreateSetupIntent<'_>) -> Response
### Description
Creates a SetupIntent object. After you create the SetupIntent, attach a payment method and confirm it to collect any required permissions to charge the payment method later.
```
--------------------------------
### HashMap IntoIterator Example
Source: https://docs.rs/async-stripe/0.41.0/stripe/type.Metadata.html?search=std%3A%3Avec
Example of creating a HashMap from an array to demonstrate the IntoIterator trait.
```rust
use std::collections::HashMap;
let map = HashMap::from([
("a", 1),
("b", 2),
("c", 3),
]);
```
--------------------------------
### retrieve
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_intent/struct.SetupIntent.html?search=
Retrieves the details of a SetupIntent that has previously been created.
```APIDOC
## pub fn retrieve(client: &Client, id: &SetupIntentId, expand: &[&str]) -> Response
### Description
Retrieves the details of a SetupIntent that has previously been created. Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string.
```
--------------------------------
### CreateSetupIntent::new
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.CreateSetupIntent.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Creates a new instance of the CreateSetupIntent struct.
```APIDOC
## pub fn new() -> Self
### Description
Creates a new instance of the `CreateSetupIntent` struct.
### Signature
`pub fn new() -> Self`
```
--------------------------------
### pub fn list(client: &Client, params: &ListSetupAttempts<'_>) -> Response>
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.SetupAttempt.html?search=u32+-%3E+bool
Retrieves a list of SetupAttempt objects associated with a specific SetupIntent.
```APIDOC
## pub fn list(client: &Client, params: &ListSetupAttempts<'_>) -> Response>
### Description
Returns a list of SetupAttempts that associate with a provided SetupIntent.
### Parameters
- **client** (&Client) - The Stripe client instance.
- **params** (&ListSetupAttempts<'_>) - The parameters for filtering and listing SetupAttempts.
```
--------------------------------
### Iterate over matches
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.TransferId.html?search=u32+-%3E+bool
Example of iterating over matches.
```rust
assert_eq!(iter.next(), Some(0..1));
assert_eq!(iter.next(), Some(3..4));
assert_eq!(iter.next(), Some(6..7));
assert_eq!(iter.next(), Some(9..10));
```
--------------------------------
### confirm
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_intent/struct.SetupIntent.html?search=
Confirms a SetupIntent.
```APIDOC
## pub fn confirm(client: &Client, setup_id: &SetupIntentId, params: ConfirmSetupIntent) -> Response
### Description
Confirms a SetupIntent object.
```
--------------------------------
### Client::get
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.Client.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Executes a GET request to the specified path.
```APIDOC
## pub fn get( &self, path: &str, ) -> Response
### Description
Make a GET http request with just a path.
```
--------------------------------
### update
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_intent/struct.SetupIntent.html?search=
Updates a SetupIntent object.
```APIDOC
## pub fn update(client: &Client, id: &SetupIntentId, params: UpdateSetupIntent<'_>) -> Response
### Description
Updates a SetupIntent object.
```
--------------------------------
### Pin::into_inner Example
Source: https://docs.rs/async-stripe/0.41.0/stripe/type.Response.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Unwrapping a Pin to retrieve the underlying pointer.
```rust
use std::pin::Pin;
let mut val: u8 = 5;
let pinned: Pin<&mut u8> = Pin::new(&mut val);
// Unwrap the pin to get the underlying mutable reference to the value. We can do
// this because `val` doesn't care about being moved, so the `Pin` was just
// a "facade" anyway.
let r = Pin::into_inner(pinned);
assert_eq!(*r, 5);
```
--------------------------------
### ConfirmSetupIntent Struct
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.ConfirmSetupIntent.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
The set of parameters that can be used when confirming a setup_intent object.
```APIDOC
## ConfirmSetupIntent
### Description
The set of parameters that can be used when confirming a setup_intent object.
### Fields
- **payment_method** (Option) - ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.
- **mandate_data** (Option) - This hash contains details about the mandate to create.
- **payment_method_data** (Option) - When included, this hash creates a PaymentMethod that is set as the payment_method value in the SetupIntent.
- **payment_method_options** (Option) - Payment method-specific configuration for this SetupIntent.
- **return_url** (Option) - The URL to redirect your customer back to after they authenticate on the payment method’s app or site.
- **use_stripe_sdk** (bool) - Set to true when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
```
--------------------------------
### Asserting split behavior
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.InvoiceLineItemId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Example showing an assertion for a split operation.
```rust
assert_eq!(d, &["a", "b", "c"]);
```
--------------------------------
### advance
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/test_helpers_test_clock/struct.TestHelpersTestClock.html?search=u32+-%3E+bool
Starts advancing a test clock to a specified time in the future.
```APIDOC
## pub fn advance(client: &Client, test_clock_id: &TestHelpersTestClockId, params: &AdvanceTestClock) -> Response
### Description
Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready.
### Parameters
- **client** (&Client) - The Stripe client instance.
- **test_clock_id** (&TestHelpersTestClockId) - The unique identifier of the test clock.
- **params** (&AdvanceTestClock) - Parameters for the advancement.
```
--------------------------------
### Product::create
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.Product.html?search=u32+-%3E+bool
Creates a new product object.
```APIDOC
## pub fn create(client: &Client, params: CreateProduct<'_>) -> Response
### Description
Creates a new product object.
```
--------------------------------
### Configure Client Request Strategy
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.Client.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Demonstrates how to clone a client and apply a specific request strategy, such as idempotency.
```rust
use stripe::RequestStrategy;
let client = stripe::Client::new("sk_test_123");
let idempotent_client = client
.clone()
.with_strategy(RequestStrategy::Idempotent("my-key".to_string()));
```
--------------------------------
### Trim end matches example
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.InvoiceLineItemId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Repeatedly removes suffixes that match a pattern.
```rust
assert_eq!("11foo1bar11".trim_end_matches('1'), "11foo1bar");
assert_eq!("123foo1bar123".trim_end_matches(char::is_numeric), "123foo1bar");
```
--------------------------------
### Client Initialization
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.Client.html?search=std%3A%3Avec
Methods for creating and configuring a new Stripe client instance.
```APIDOC
## Client::new(secret_key: impl Into) -> Self
### Description
Creates a new account with the given secret key.
## Client::from_url(url: impl Into<&'a str>, secret_key: impl Into) -> Self
### Description
Creates a new account pointed at a specific URL. This is useful for testing. Panics if the URL cannot be parsed.
## Client::with_client_id(self, id: ApplicationId) -> Self
### Description
Sets the client ID for the client.
## Client::with_stripe_account(self, id: AccountId) -> Self
### Description
Sets the Stripe account for the client.
## Client::with_strategy(self, strategy: RequestStrategy) -> Self
### Description
Sets the request strategy for the client.
## Client::with_app_info(self, name: String, version: Option, url: Option) -> Self
### Description
Sets the application info for the client. It is recommended that applications set this so that Stripe is able to understand usage patterns from your user agent.
```
--------------------------------
### Define SetupAttemptPaymentMethodDetailsAcssDebit struct
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.SetupAttemptPaymentMethodDetailsAcssDebit.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
The core structure definition for ACSS Debit payment method details in setup attempts.
```rust
pub struct SetupAttemptPaymentMethodDetailsAcssDebit {}
```
--------------------------------
### Strip suffix example
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.InvoiceLineItemId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Removes a suffix exactly once if present, returning an Option.
```rust
assert_eq!("bar:foo".strip_suffix(":foo"), Some("bar"));
assert_eq!("bar:foo".strip_suffix("bar"), None);
assert_eq!("foofoo".strip_suffix("foo"), Some("foo"));
```
--------------------------------
### Strip prefix example
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.InvoiceLineItemId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Removes a prefix exactly once if present, returning an Option.
```rust
assert_eq!("foo:bar".strip_prefix("foo:"), Some("bar"));
assert_eq!("foo:bar".strip_prefix("bar"), None);
assert_eq!("foofoo".strip_prefix("foo"), Some("foo"));
```
--------------------------------
### BaseClient::new
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.BaseClient.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Creates a new instance of the BaseClient.
```APIDOC
### pub fn new() -> Self
Creates a new instance of the `BaseClient`.
```
--------------------------------
### Using rsplit_terminator
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.InvoiceLineItemId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Examples demonstrating reverse splitting where the pattern acts as a terminator.
```rust
let v: Vec<&str> = "A.B.".rsplit_terminator('.').collect();
assert_eq!(v, ["B", "A"]);
let v: Vec<&str> = "A..B..".rsplit_terminator(".").collect();
assert_eq!(v, ["", "B", "", "A"]);
```
--------------------------------
### SetupIntentPaymentMethodOptionsPaypal Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_intent/struct.SetupIntentPaymentMethodOptionsPaypal.html?search=u32+-%3E+bool
The structure definition for PayPal payment method options within a SetupIntent.
```rust
pub struct SetupIntentPaymentMethodOptionsPaypal {
pub billing_agreement_id: Option,
}
```
--------------------------------
### Split string with rsplitn
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.TopupId.html?search=std%3A%3Avec
Splits a string into at most n substrings starting from the end.
```rust
let v: Vec<&str> = "Mary had a little lamb".rsplitn(3, ' ').collect();
assert_eq!(v, ["lamb", "little", "Mary had a"]);
let v: Vec<&str> = "lionXXtigerXleopard".rsplitn(3, "X").collect();
assert_eq!(v, ["leopard", "tiger", "lionX"]);
let v: Vec<&str> = "lion::tiger::leopard".rsplitn(2, "::").collect();
assert_eq!(v, ["leopard", "lion::tiger"]);
```
```rust
let v: Vec<&str> = "abc1defXghi".rsplitn(2, |c| c == '1' || c == 'X').collect();
assert_eq!(v, ["ghi", "abc1def"]);
```
--------------------------------
### Trim start matches by pattern
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.InvoiceLineItemId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Removes prefixes that match a specified pattern.
```rust
assert_eq!("11foo1bar11".trim_start_matches('1'), "foo1bar11");
assert_eq!("123foo1bar123".trim_start_matches(char::is_numeric), "foo1bar123");
```
--------------------------------
### Initialize Stripe Client
Source: https://docs.rs/async-stripe/0.41.0/stripe/index.html?search=u32+-%3E+bool
Create a new Stripe client instance using your secret API key.
```rust
let client = stripe::Client::new("sk_test_YOUR_STRIPE_SECRET");
```
--------------------------------
### Trim start of string
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.InvoiceLineItemId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Removes leading Unicode whitespace from a string slice.
```rust
let s = "\n Hello\tworld\t\n";
assert_eq!("Hello\tworld\t\n", s.trim_start());
```
```rust
let s = " English ";
assert!(Some('E') == s.trim_start().chars().next());
```
--------------------------------
### TokioClient::new
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.BaseClient.html?search=u32+-%3E+bool
Creates a new instance of the TokioClient.
```APIDOC
## pub fn new() -> Self
### Description
Creates a new instance of the TokioClient.
### Returns
- **Self** - A new instance of the client.
```
--------------------------------
### SetupIntent Operations
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.SetupIntent.html?search=u32+-%3E+bool
Methods for interacting with SetupIntent objects in the Stripe API.
```APIDOC
## SetupIntent Methods
### list
Returns a list of SetupIntents.
Signature: `pub fn list(client: &Client, params: &ListSetupIntents<'_>) -> Response>`
### create
Creates a SetupIntent object.
Signature: `pub fn create(client: &Client, params: CreateSetupIntent<'_>) -> Response`
### retrieve
Retrieves the details of a SetupIntent that has previously been created.
Signature: `pub fn retrieve(client: &Client, id: &SetupIntentId, expand: &[&str]) -> Response`
### update
Updates a SetupIntent object.
Signature: `pub fn update(client: &Client, id: &SetupIntentId, params: UpdateSetupIntent<'_>) -> Response`
### confirm
Confirms a SetupIntent.
Signature: `pub fn confirm(client: &Client, setup_id: &SetupIntentId, params: ConfirmSetupIntent) -> Response`
### verify_micro_deposits
Verifies micro-deposits for a SetupIntent.
Signature: `pub fn verify_micro_deposits(client: &Client, setup_id: &SetupIntentId, params: VerifyMicrodeposits<'_>) -> Response`
### cancel
Cancels a SetupIntent object that is in a cancellable status.
Signature: `pub fn cancel(client: &Client, setup_id: &SetupIntentId, params: CancelSetupIntent) -> Response`
```
--------------------------------
### Match indices in string
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.InvoiceLineItemId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Returns an iterator over disjoint matches and their starting indices.
```rust
let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect();
assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]);
let v: Vec<_> = "1abcabc2".match_indices("abc").collect();
assert_eq!(v, [(1, "abc"), (4, "abc")]);
let v: Vec<_> = "ababa".match_indices("aba").collect();
assert_eq!(v, [(0, "aba")]); // only the first `aba`
```
--------------------------------
### pub fn create(client: &Client, params: CreateCustomer<'_>) -> Response
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/customer/struct.Customer.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Creates a new customer object.
```APIDOC
## create
### Description
Creates a new customer object.
### Parameters
- **client** (&Client) - The Stripe client instance.
- **params** (CreateCustomer<'_>) - The customer creation parameters.
```
--------------------------------
### pub fn list(client: &Client, params: &ListTopups<'_>) -> Response>
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.Topup.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Returns a list of top-ups.
```APIDOC
## list
### Description
Returns a list of top-ups.
### Parameters
- **client** (&Client) - Required - The API client instance.
- **params** (&ListTopups<'_>) - Required - Parameters for filtering and pagination of the top-up list.
### Response
- **Response>** - A response object containing a list of Topup objects.
```
--------------------------------
### Using split_inclusive
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.InvoiceLineItemId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Examples demonstrating how split_inclusive retains the matched pattern as a terminator for each substring.
```rust
let v: Vec<&str> = "Mary had a little lamb\nlittle lamb\nlittle lamb."
.split_inclusive('\n').collect();
assert_eq!(v, ["Mary had a little lamb\n", "little lamb\n", "little lamb."]);
```
```rust
let v: Vec<&str> = "Mary had a little lamb\nlittle lamb\nlittle lamb.\n"
.split_inclusive('\n').collect();
assert_eq!(v, ["Mary had a little lamb\n", "little lamb\n", "little lamb.\n"]);
```
--------------------------------
### Check prefix and suffix
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.ConnectCollectionTransferId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Verifies if a string slice starts or ends with a specific pattern.
```rust
let bananas = "bananas";
assert!(bananas.starts_with("bana"));
assert!(!bananas.starts_with("nana"));
```
```rust
let bananas = "bananas";
// Note that both of these assert successfully.
assert!(bananas.starts_with(&['b', 'a', 'n', 'a']));
assert!(bananas.starts_with(&['a', 'b', 'c', 'd']));
```
```rust
let bananas = "bananas";
assert!(bananas.ends_with("anas"));
assert!(!bananas.ends_with("nana"));
```
--------------------------------
### SetupIntent Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_intent/struct.SetupIntent.html?search=
The definition of the SetupIntent struct including all available fields.
```rust
pub struct SetupIntent {Show 24 fields
pub id: SetupIntentId,
pub application: Option>,
pub attach_to_self: Option,
pub automatic_payment_methods: Option,
pub cancellation_reason: Option,
pub client_secret: Option,
pub created: Timestamp,
pub customer: Option>,
pub description: Option,
pub flow_directions: Option>,
pub last_setup_error: Option>,
pub latest_attempt: Option>,
pub livemode: bool,
pub mandate: Option>,
pub metadata: Option,
pub next_action: Option,
pub on_behalf_of: Option>,
pub payment_method: Option>,
pub payment_method_configuration_details: Option,
pub payment_method_options: Option,
pub payment_method_types: Vec,
pub single_use_mandate: Option>,
pub status: SetupIntentStatus,
pub usage: String,
}
```
--------------------------------
### SetupAttempt::list
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_attempt/struct.SetupAttempt.html?search=u32+-%3E+bool
Retrieves a list of SetupAttempt objects associated with a specific SetupIntent.
```APIDOC
## SetupAttempt::list
### Description
Returns a list of SetupAttempts that associate with a provided SetupIntent.
### Signature
`pub fn list(client: &Client, params: &ListSetupAttempts<'_>) -> Response>`
### Parameters
- **client** (&Client) - The Stripe API client instance.
- **params** (&ListSetupAttempts<'_>) - The parameters used to filter or paginate the list of SetupAttempts.
```
--------------------------------
### Check string prefix
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.InvoiceLineItemId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Returns true if the pattern matches the start of the string slice.
```rust
let bananas = "bananas";
assert!(bananas.starts_with("bana"));
assert!(!bananas.starts_with("nana"));
```
```rust
let bananas = "bananas";
// Note that both of these assert successfully.
assert!(bananas.starts_with(&['b', 'a', 'n', 'a']));
assert!(bananas.starts_with(&['a', 'b', 'c', 'd']));
```
--------------------------------
### Get mutable reference to value
Source: https://docs.rs/async-stripe/0.41.0/stripe/type.Metadata.html?search=std%3A%3Avec
Retrieves a mutable reference to the value associated with a key.
```rust
use std::collections::HashMap;
let mut map = HashMap::new();
map.insert(1, "a");
if let Some(x) = map.get_mut(&1) {
*x = "b";
}
assert_eq!(map[&1], "b");
```
--------------------------------
### SetupIntentNextActionRedirectToUrl Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_intent/struct.SetupIntentNextActionRedirectToUrl.html?search=
The structure definition for handling redirect URLs during SetupIntent authentication.
```rust
pub struct SetupIntentNextActionRedirectToUrl {
pub return_url: Option,
pub url: Option,
}
```
--------------------------------
### CreateSetupIntent Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_intent/struct.CreateSetupIntent.html?search=
The structure containing all configurable fields for creating a SetupIntent.
```rust
pub struct CreateSetupIntent<'a> {Show 18 fields
pub attach_to_self: Option,
pub automatic_payment_methods: Option,
pub confirm: Option,
pub customer: Option,
pub description: Option<&'a str>,
pub expand: &'a [&'a str],
pub flow_directions: Option>,
pub mandate_data: Option,
pub metadata: Option,
pub on_behalf_of: Option<&'a str>,
pub payment_method: Option,
pub payment_method_configuration: Option,
pub payment_method_data: Option,
pub payment_method_options: Option,
pub payment_method_types: Option>,
pub return_url: Option<&'a str>,
pub single_use: Option,
pub use_stripe_sdk: Option,
}
```
--------------------------------
### PaymentMethodDetailsCardInstallments Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/charge/struct.PaymentMethodDetailsCardInstallments.html?search=
The primary structure definition for handling card installment details.
```rust
pub struct PaymentMethodDetailsCardInstallments {
pub plan: Option,
}
```
--------------------------------
### CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallments Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/billing/invoice/struct.CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallments.html?search=std%3A%3Avec
The structure definition for configuring card installments on an invoice payment.
```rust
pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallments {
pub enabled: Option,
pub plan: Option,
}
```
--------------------------------
### ListSetupIntents Struct
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.ListSetupIntents.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
The ListSetupIntents struct defines the available parameters for listing SetupIntents.
```APIDOC
## ListSetupIntents
### Description
Parameters for the `SetupIntent::list` operation.
### Fields
- **attach_to_self** (Option) - If true, the SetupIntent’s payment method will be attached to the in-context Stripe Account.
- **created** (Option>) - Filter on the object `created` field.
- **customer** (Option) - Filter by customer ID.
- **ending_before** (Option) - Cursor for pagination (previous page).
- **expand** (&'a [&'a str]) - Specifies fields to expand in the response.
- **limit** (Option) - Limit the number of objects returned (1-100, default 10).
- **payment_method** (Option) - Filter by payment method ID.
- **starting_after** (Option) - Cursor for pagination (next page).
```
--------------------------------
### list
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/billing/plan/struct.Plan.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Returns a list of your plans.
```APIDOC
## pub fn list(client: &Client, params: &ListPlans<'_>) -> Response>
### Description
Returns a list of your plans.
```
--------------------------------
### Define UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType Enum
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
The enum definition for the payment intent installment plan type.
```rust
pub enum UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
FixedCount,
}
```
--------------------------------
### Define CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage Enum
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage.html?search=u32+-%3E+bool
The enum definition for OXXO setup future usage options.
```rust
pub enum CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage {
None,
}
```
--------------------------------
### create
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.Customer.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Creates a new customer object.
```APIDOC
## pub fn create(client: &Client, params: CreateCustomer<'_>) -> Response
### Description
Creates a new customer object.
```
--------------------------------
### SetupIntentPaymentMethodOptions Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_intent/struct.SetupIntentPaymentMethodOptions.html?search=u32+-%3E+bool
The structure containing optional configuration fields for various payment methods supported by a SetupIntent.
```rust
pub struct SetupIntentPaymentMethodOptions {
pub acss_debit: Option,
pub card: Option,
pub link: Option,
pub paypal: Option,
pub sepa_debit: Option,
pub us_bank_account: Option,
}
```
--------------------------------
### Period Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/billing/usage_record_summary/struct.Period.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
The structure definition for Period, containing optional start and end timestamps.
```rust
pub struct Period {
pub end: Option,
pub start: Option,
}
```
--------------------------------
### Trim ASCII whitespace from start
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.TokenId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Remove leading ASCII whitespace characters from a string slice.
```rust
assert_eq!(" \t \u{3000}hello world\n".trim_ascii_start(), "\u{3000}hello world\n");
assert_eq!(" ".trim_ascii_start(), "");
assert_eq!("".trim_ascii_start(), "");
```
--------------------------------
### list
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/connect/topup/struct.Topup.html?search=u32+-%3E+bool
Returns a list of top-ups.
```APIDOC
## pub fn list(client: &Client, params: &ListTopups<'_>) -> Response>
### Description
Returns a list of top-ups.
```
--------------------------------
### SetupIntentNextAction Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_intent/struct.SetupIntentNextAction.html?search=
The structure definition for SetupIntentNextAction, containing optional fields for various next-action types.
```rust
pub struct SetupIntentNextAction {
pub cashapp_handle_redirect_or_display_qr_code: Option,
pub redirect_to_url: Option,
pub type_: String,
pub use_stripe_sdk: Option,
pub verify_with_microdeposits: Option,
}
```
--------------------------------
### Get Raw Pointer to String
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.InvoiceLineItemId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Obtains a raw pointer to the first byte of a string slice.
```rust
let s = "Hello";
let ptr = s.as_ptr();
```
--------------------------------
### UpdatePaymentIntentPaymentMethodOptionsCardInstallments Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.UpdatePaymentIntentPaymentMethodOptionsCardInstallments.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
The primary structure used to configure card installments for a PaymentIntent update.
```rust
pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallments {
pub enabled: Option,
pub plan: Option,
}
```
--------------------------------
### create
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/terminal/terminal_configuration/struct.TerminalConfiguration.html?search=
Creates a new TerminalConfiguration object.
```APIDOC
## create
### Description
Creates a new Configuration object.
### Signature
`pub fn create(client: &Client, params: CreateTerminalConfiguration<'_>) -> Response`
```
--------------------------------
### CreateCheckoutSessionPaymentMethodOptionsCardInstallments Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.CreateCheckoutSessionPaymentMethodOptionsCardInstallments.html?search=std%3A%3Avec
The struct definition for configuring card installments, available only when the 'checkout' feature is enabled.
```rust
pub struct CreateCheckoutSessionPaymentMethodOptionsCardInstallments {
pub enabled: Option,
}
```
--------------------------------
### UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/payment_intent/struct.UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan.html?search=
The structure used to define installment plan parameters for card payments.
```rust
pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
pub count: u64,
pub interval: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval,
pub type_: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType,
}
```
--------------------------------
### cancel
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_intent/struct.SetupIntent.html?search=
Cancels a SetupIntent.
```APIDOC
## pub fn cancel(client: &Client, setup_id: &SetupIntentId, params: CancelSetupIntent) -> Response
### Description
A SetupIntent object can be canceled when it is in one of these statuses: requires_payment_method, requires_confirmation, or requires_action.
```
--------------------------------
### CreatePromotionCode::new
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.CreatePromotionCode.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Initializes a new instance of the CreatePromotionCode builder with the required coupon identifier.
```APIDOC
## pub fn new(coupon: &'a str) -> Self
### Description
Creates a new builder for a promotion code associated with the specified coupon.
### Parameters
- **coupon** (&str) - Required - The ID of the coupon to associate with the promotion code.
```
--------------------------------
### CreatePaymentIntentPaymentMethodOptionsCardInstallments Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/payment_intent/struct.CreatePaymentIntentPaymentMethodOptionsCardInstallments.html?search=
The primary structure used to configure card installment options for a PaymentIntent.
```rust
pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallments {
pub enabled: Option,
pub plan: Option,
}
```
--------------------------------
### pub fn create(client: &Client, params: CreatePrice<'_>) -> Response
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/price/struct.Price.html?search=std%3A%3Avec
Creates a new price for an existing product, supporting both recurring and one-time pricing.
```APIDOC
## pub fn create(client: &Client, params: CreatePrice<'_>) -> Response
### Description
Creates a new price for an existing product. The price can be recurring or one-time.
### Parameters
- **client** (&Client) - The Stripe client instance.
- **params** (CreatePrice<'_>) - The configuration parameters for the new price.
```
--------------------------------
### Define UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval Enum
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
The enum structure representing the interval field for card installment plans.
```rust
pub enum UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
Month,
}
```
--------------------------------
### SetupAttemptPaymentMethodDetailsIdeal Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.SetupAttemptPaymentMethodDetailsIdeal.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
The structure definition for SetupAttemptPaymentMethodDetailsIdeal, containing optional fields for iDEAL payment method details.
```rust
pub struct SetupAttemptPaymentMethodDetailsIdeal {
pub bank: Option,
pub bic: Option,
pub generated_sepa_debit: Option>,
pub generated_sepa_debit_mandate: Option>,
pub iban_last4: Option,
pub verified_name: Option,
}
```
--------------------------------
### Define CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType Enum
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
The enum definition representing the possible values for the installment plan type.
```rust
pub enum CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
FixedCount,
}
```
--------------------------------
### Define CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval Enum
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
The enum structure representing the interval field for card installment plans.
```rust
pub enum CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
Month,
}
```
--------------------------------
### SetupIntentPaymentMethodOptionsCard Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_intent/struct.SetupIntentPaymentMethodOptionsCard.html?search=u32+-%3E+bool
The structure definition for SetupIntentPaymentMethodOptionsCard, containing optional fields for mandate options, network, and 3D Secure requests.
```rust
pub struct SetupIntentPaymentMethodOptionsCard {
pub mandate_options: Option,
pub network: Option,
pub request_three_d_secure: Option,
}
```
--------------------------------
### SetupIntentPaymentMethodOptionsLink Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.SetupIntentPaymentMethodOptionsLink.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
The structure definition for SetupIntentPaymentMethodOptionsLink, containing a single optional persistent_token field.
```rust
pub struct SetupIntentPaymentMethodOptionsLink {
pub persistent_token: Option,
}
```
--------------------------------
### ConfirmSetupIntent Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.ConfirmSetupIntent.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
The structure containing parameters for confirming a SetupIntent, including payment method details and redirection URLs.
```rust
pub struct ConfirmSetupIntent {
pub payment_method: Option,
pub mandate_data: Option,
pub payment_method_data: Option,
pub payment_method_options: Option,
pub return_url: Option,
pub use_stripe_sdk: bool,
}
```
--------------------------------
### Define PaymentMethodOptionsPromptpaySetupFutureUsage Enum
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.PaymentMethodOptionsPromptpaySetupFutureUsage.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
The definition of the enum used for PromptPay setup future usage options.
```rust
pub enum PaymentMethodOptionsPromptpaySetupFutureUsage {
None,
}
```
--------------------------------
### SetupIntentPaymentMethodOptionsUsBankAccount Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_intent/struct.SetupIntentPaymentMethodOptionsUsBankAccount.html?search=
The structure definition for configuring US bank account payment method options in a SetupIntent.
```rust
pub struct SetupIntentPaymentMethodOptionsUsBankAccount {
pub financial_connections: Option,
pub mandate_options: Option,
pub verification_method: Option,
}
```
--------------------------------
### Define PaymentMethodOptionsAfterpayClearpaySetupFutureUsage Enum
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.PaymentMethodOptionsAfterpayClearpaySetupFutureUsage.html?search=u32+-%3E+bool
The definition of the enum used for Afterpay/Clearpay setup future usage configuration.
```rust
pub enum PaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
None,
}
```
--------------------------------
### SetupAttemptPaymentMethodDetails Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_attempt/struct.SetupAttemptPaymentMethodDetails.html?search=
The structure definition for SetupAttemptPaymentMethodDetails, containing optional fields for different payment method types.
```rust
pub struct SetupAttemptPaymentMethodDetails {Show 16 fields
pub acss_debit: Option,
pub au_becs_debit: Option,
pub bacs_debit: Option,
pub bancontact: Option,
pub boleto: Option,
pub card: Option,
pub card_present: Option,
pub cashapp: Option,
pub ideal: Option,
pub klarna: Option,
pub link: Option,
pub paypal: Option,
pub sepa_debit: Option,
pub sofort: Option,
pub type_: String,
pub us_bank_account: Option,
}
```
--------------------------------
### Define CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage Enum
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
The enum definition for WeChat Pay setup future usage options.
```rust
pub enum CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage {
None,
}
```
--------------------------------
### CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage Enum Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
The definition of the enum used for Klarna setup future usage options.
```rust
pub enum CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage {
None,
}
```
--------------------------------
### SetupAttemptPaymentMethodDetailsBoleto Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_attempt/struct.SetupAttemptPaymentMethodDetailsBoleto.html?search=u32+-%3E+bool
The primary definition of the SetupAttemptPaymentMethodDetailsBoleto struct.
```rust
pub struct SetupAttemptPaymentMethodDetailsBoleto {}
```
--------------------------------
### Splitting String Slices
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.OrderReturnId.html?search=std%3A%3Avec
Examples for splitting strings at a byte offset using both panicking and checked variants.
```rust
let s = "Per Martin-Löf";
let (first, last) = s.split_at(3);
assert_eq!("Per", first);
assert_eq!(" Martin-Löf", last);
```
```rust
let s = "Per Martin-Löf";
let (first, last) = s.split_at_checked(3).unwrap();
assert_eq!("Per", first);
assert_eq!(" Martin-Löf", last);
assert_eq!(None, s.split_at_checked(13)); // Inside “ö”
assert_eq!(None, s.split_at_checked(16)); // Beyond the string length
```
--------------------------------
### ListPaymentMethods::new
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.ListPaymentMethods.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Creates a new instance of the ListPaymentMethods struct.
```APIDOC
## pub fn new() -> Self
### Description
Creates a new instance of the ListPaymentMethods struct.
### Signature
`pub fn new() -> Self`
```
--------------------------------
### Trim suffix example
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.InvoiceLineItemId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Nightly-only API that removes a suffix if present, returning the original string otherwise.
```rust
#![feature(trim_prefix_suffix)]
// Suffix present - removes it
assert_eq!("bar:foo".trim_suffix(":foo"), "bar");
assert_eq!("foofoo".trim_suffix("foo"), "foo");
// Suffix absent - returns original string
assert_eq!("bar:foo".trim_suffix("bar"), "bar:foo");
// Method chaining example
assert_eq!("".trim_prefix('<').trim_suffix('>'), "https://example.com/");
```
--------------------------------
### ListFiles::new
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.ListFiles.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Creates a new instance of the ListFiles structure.
```APIDOC
## pub fn new() -> Self
### Description
Creates a new instance of the ListFiles structure.
```
--------------------------------
### Trim prefix example
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.InvoiceLineItemId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Nightly-only API that removes a prefix if present, returning the original string otherwise.
```rust
#![feature(trim_prefix_suffix)]
// Prefix present - removes it
assert_eq!("foo:bar".trim_prefix("foo:"), "bar");
assert_eq!("foofoo".trim_prefix("foo"), "foo");
// Prefix absent - returns original string
assert_eq!("foo:bar".trim_prefix("bar"), "foo:bar");
// Method chaining example
assert_eq!("".trim_prefix('<').trim_suffix('>'), "https://example.com/");
```
--------------------------------
### Product::list
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.Product.html?search=u32+-%3E+bool
Returns a list of your products, sorted by creation date.
```APIDOC
## pub fn list(client: &Client, params: &ListProducts<'_>) -> Response>
### Description
Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.
```
--------------------------------
### CreateCheckoutSession::new
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.CreateCheckoutSession.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Creates a new instance of the CreateCheckoutSession struct.
```APIDOC
## pub fn new() -> Self
### Description
Creates a new instance of the CreateCheckoutSession struct.
### Signature
`pub fn new() -> Self`
```
--------------------------------
### Retrieving Expanded Objects
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.Expandable.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Example of using the expand parameter during a retrieval call to load nested objects.
```rust
Charge::retrieve(&client, &charge_id, &["invoice.customer"])
```
--------------------------------
### SubscriptionScheduleCurrentPhase Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/struct.SubscriptionScheduleCurrentPhase.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
The core structure definition for SubscriptionScheduleCurrentPhase, containing start and end date timestamps.
```rust
pub struct SubscriptionScheduleCurrentPhase {
pub end_date: Timestamp,
pub start_date: Timestamp,
}
```
--------------------------------
### UpdateSetupIntent Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_intent/struct.UpdateSetupIntent.html?search=
The structure definition for updating a SetupIntent, containing optional fields for configuration and metadata.
```rust
pub struct UpdateSetupIntent<'a> {
pub attach_to_self: Option,
pub customer: Option,
pub description: Option<&'a str>,
pub expand: &'a [&'a str],
pub flow_directions: Option>,
pub metadata: Option,
pub payment_method: Option,
pub payment_method_configuration: Option,
pub payment_method_data: Option,
pub payment_method_options: Option,
pub payment_method_types: Option>,
}
```
--------------------------------
### Trim start of a string
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.InvoiceLineItemId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Demonstrates removing leading whitespace from a string, including handling of right-to-left languages.
```rust
let s = " עברית ";
assert!(Some('ע') == s.trim_start().chars().next());
```
--------------------------------
### create
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/test_helpers_test_clock/struct.TestHelpersTestClock.html?search=u32+-%3E+bool
Creates a new test clock that can be attached to new customers and quotes.
```APIDOC
## pub fn create(client: &Client, params: &CreateTestClock<'_>) -> Response
### Description
Creates a new test clock that can be attached to new customers and quotes.
### Parameters
- **client** (&Client) - The Stripe client instance.
- **params** (&CreateTestClock) - Parameters for creating the test clock.
```
--------------------------------
### SetupAttempt Struct Definition
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/core/setup_attempt/struct.SetupAttempt.html?search=u32+-%3E+bool
The definition of the SetupAttempt struct showing its 14 fields.
```rust
pub struct SetupAttempt {Show 14 fields
pub id: SetupAttemptId,
pub application: Option>,
pub attach_to_self: Option,
pub created: Timestamp,
pub customer: Option>,
pub flow_directions: Option>,
pub livemode: bool,
pub on_behalf_of: Option>,
pub payment_method: Expandable,
pub payment_method_details: SetupAttemptPaymentMethodDetails,
pub setup_error: Option>,
pub setup_intent: Expandable,
pub status: String,
pub usage: String,
}
```
--------------------------------
### Reverse match indices in string
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.InvoiceLineItemId.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
Returns an iterator over disjoint matches and their starting indices in reverse order.
```rust
let v: Vec<_> = "abcXXXabcYYYabc".rmatch_indices("abc").collect();
assert_eq!(v, [(12, "abc"), (6, "abc"), (0, "abc")]);
let v: Vec<_> = "1abcabc2".rmatch_indices("abc").collect();
assert_eq!(v, [(4, "abc"), (1, "abc")]);
let v: Vec<_> = "ababa".rmatch_indices("aba").collect();
assert_eq!(v, [(2, "aba")]); // only the last `aba`
```
--------------------------------
### create
Source: https://docs.rs/async-stripe/0.41.0/stripe/generated/connect/account/struct.Account.html?search=
Creates a new Stripe account for your users.
```APIDOC
## pub fn create(client: &Client, params: CreateAccount<'_>) -> Response
### Description
With Connect, you can create Stripe accounts for your users. You can prefill information when creating the account, which will be skipped during Connect Onboarding.
```
--------------------------------
### Get String Representation of Locale
Source: https://docs.rs/async-stripe/0.41.0/stripe/enum.CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E
The as_str method returns the static string representation of the enum variant.
```rust
pub fn as_str(self) -> &'static str
```