Add Serde to "Persisting tokens" documentation
This commit is contained in:
parent
3cf2af8609
commit
6808f6bada
15
src/lib.rs
15
src/lib.rs
|
@ -108,7 +108,8 @@
|
||||||
//!
|
//!
|
||||||
//! ### Persisting tokens
|
//! ### Persisting tokens
|
||||||
//!
|
//!
|
||||||
//! All token types implement `Encodable` and `Decodable` from `rustc_serialize`.
|
//! All token types implement `Encodable` / `Decodable` from `rustc_serialize` and `Serialize` /
|
||||||
|
//! `Deserialize` from `serde`.
|
||||||
//!
|
//!
|
||||||
//! ```no_run
|
//! ```no_run
|
||||||
//! # extern crate inth_oauth2;
|
//! # extern crate inth_oauth2;
|
||||||
|
@ -122,6 +123,18 @@
|
||||||
//! let json = json::encode(&token).unwrap();
|
//! let json = json::encode(&token).unwrap();
|
||||||
//! # }
|
//! # }
|
||||||
//! ```
|
//! ```
|
||||||
|
//!
|
||||||
|
//! ```no_run
|
||||||
|
//! # extern crate inth_oauth2;
|
||||||
|
//! extern crate serde_json;
|
||||||
|
//! # use inth_oauth2::Client;
|
||||||
|
//! # use inth_oauth2::provider::Google;
|
||||||
|
//! # fn main() {
|
||||||
|
//! # let client = Client::<Google>::new(Default::default(), "", "", None);
|
||||||
|
//! # let token = client.request_token("").unwrap();
|
||||||
|
//! let json = serde_json::to_string(&token).unwrap();
|
||||||
|
//! # }
|
||||||
|
//! ```
|
||||||
|
|
||||||
#![warn(
|
#![warn(
|
||||||
missing_docs,
|
missing_docs,
|
||||||
|
|
Loading…
Reference in New Issue