Skip to content

Commit

Permalink
Merge pull request #616 from arlyon/arlyon/client-clone-docs
Browse files Browse the repository at this point in the history
docs: add clone docs for strategy (closes #520)
  • Loading branch information
arlyon authored Sep 24, 2024
2 parents fcb1230 + be76ed5 commit 9705163
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/client/stripe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ impl Client {
}

/// Set the request strategy for the client.
///
/// Note: the client is cheap to clone so if you require a new client
/// temporarily with a new strategy you can simply clone it
/// and keep going.
///
/// ```no_run
/// use stripe::RequestStrategy;
/// let client = stripe::Client::new("sk_test_123");
/// let idempotent_client = client
/// .clone()
/// .with_strategy(RequestStrategy::Idempotent("my-key".to_string()));
/// ```
pub fn with_strategy(mut self, strategy: RequestStrategy) -> Self {
self.strategy = strategy;
self
Expand Down

0 comments on commit 9705163

Please sign in to comment.