Skip to content

Commit

Permalink
docs: add clone docs for strategy (closes #520)
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon committed Apr 9, 2024
1 parent 7ef5d37 commit 7031b91
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/client/stripe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ 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
/// 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 7031b91

Please sign in to comment.