|
69 | 69 | //! |
70 | 70 | //! # Usage |
71 | 71 | //! |
| 72 | +//! ## Setting up your Project |
| 73 | +//! |
| 74 | +//! To use this library, you would put the following lines into your `Cargo.toml` file: |
| 75 | +//! |
| 76 | +//! ```toml |
| 77 | +//! [dependencies] |
| 78 | +//! youtube3 = "0.0.1" |
| 79 | +//! ``` |
| 80 | +//! |
72 | 81 | //! ## A complete example |
73 | 82 | //! |
74 | 83 | //! ```test_harness,no_run |
|
82 | 91 | //! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; |
83 | 92 | //! use youtube3::YouTube; |
84 | 93 | //! |
85 | | -//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and `client_secret`, |
86 | | -//! // among other things. |
| 94 | +//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and |
| 95 | +//! // `client_secret`, among other things. |
87 | 96 | //! let secret: ApplicationSecret = Default::default(); |
88 | 97 | //! // Instantiate the authenticator. It will choose a suitable authentication flow for you, |
89 | | -//! // unless you replace `None` with the desired Flow |
90 | | -//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about what's going on |
91 | | -//! // You probably want to bring in your own `TokenStorage` to persist tokens and retrieve them from storage. |
| 98 | +//! // unless you replace `None` with the desired Flow. |
| 99 | +//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about |
| 100 | +//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and |
| 101 | +//! // retrieve them from storage. |
92 | 102 | //! let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, |
93 | 103 | //! hyper::Client::new(), |
94 | 104 | //! <MemoryStorage as Default>::default(), None); |
@@ -267,13 +277,14 @@ impl Default for Scope { |
267 | 277 | /// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; |
268 | 278 | /// use youtube3::YouTube; |
269 | 279 | /// |
270 | | -/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and `client_secret`, |
271 | | -/// // among other things. |
| 280 | +/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and |
| 281 | +/// // `client_secret`, among other things. |
272 | 282 | /// let secret: ApplicationSecret = Default::default(); |
273 | 283 | /// // Instantiate the authenticator. It will choose a suitable authentication flow for you, |
274 | | -/// // unless you replace `None` with the desired Flow |
275 | | -/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about what's going on |
276 | | -/// // You probably want to bring in your own `TokenStorage` to persist tokens and retrieve them from storage. |
| 284 | +/// // unless you replace `None` with the desired Flow. |
| 285 | +/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about |
| 286 | +/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and |
| 287 | +/// // retrieve them from storage. |
277 | 288 | /// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, |
278 | 289 | /// hyper::Client::new(), |
279 | 290 | /// <MemoryStorage as Default>::default(), None); |
|
0 commit comments