Add example to crate root
This commit is contained in:
parent
ca86b987e4
commit
c76d0d9d89
14
src/lib.rs
14
src/lib.rs
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue