Add example to crate root

This commit is contained in:
Koen Bolhuis 2021-01-20 01:11:47 +01:00
parent ca86b987e4
commit c76d0d9d89
1 changed files with 14 additions and 0 deletions

View File

@ -8,6 +8,20 @@
//! map one-to-one to the HTTP API's JSON input- and response data. Using the `ListenBrainz`
//! type is therefore recommended.
//!
//! # Example
//!
//! ```no_run
//! # use listenbrainz::ListenBrainz;
//! #
//! let mut client = ListenBrainz::new();
//!
//! client.authenticate("LISTENBRAINZ TOKEN")
//! .expect("Could not authenticate with ListenBrainz");
//!
//! client.playing_now("The Beatles", "Here Comes the Sun", "Abbey Road")
//! .expect("Could not submit 'playing now' request");
//! ```
//!
//! [ListenBrainz HTTP API]: https://listenbrainz.readthedocs.io/en/production/dev/api/
mod error;