1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//! Client library for the <https://api.radio-browser.info> API
//!
//! # Example blocking
//! It needs to have the feature "blocking" enabled.
//! ```toml
//! radiobrowser = { version = "*", features = ["blocking"] }
//! ```
//! ```rust
//! use radiobrowser::blocking::RadioBrowserAPI;
//! use std::error::Error;
//! 
//! fn main() -> Result<(), Box<dyn Error>> {
//!     let api = RadioBrowserAPI::new()?;
//!     let servers = RadioBrowserAPI::get_default_servers()?;
//!     println!("Servers: {:?}", servers);
//!     let countries = api.get_countries().send()?;
//!     println!("Countries: {:?}", countries);
//!     let stations = api.get_stations().name("jazz").send()?;
//!     println!("Stations: {:?}", stations);
//!     Ok(())
//! }
//! ```
//! 
//! # Example async
//! ```rust
//! use std::error::Error;
//! use futures::join;
//! use radiobrowser::RadioBrowserAPI;
//! use radiobrowser::StationOrder;
//! 
//! #[async_std::main]
//! async fn main() -> Result<(), Box<dyn Error>> {
//!     let mut api = RadioBrowserAPI::new().await?;
//!     let countries = api.get_countries().send();
//!     let languages = api.get_languages().send();
//!     let stations = api
//!         .get_stations()
//!         .name("jazz")
//!         .reverse(true)
//!         .order(StationOrder::Clickcount)
//!         .send();
//!     let config = api.get_server_config();
//!     let (stations, config, countries, languages) = join!(stations, config, countries, languages);
//! 
//!     println!("Config: {:#?}", config?);
//!     println!("Countries found: {}", countries?.len());
//!     println!("Languages found: {}", languages?.len());
//!     println!("Stations found: {}", stations?.len());
//!     Ok(())
//! }
//! ```

mod api;
#[doc()]
#[cfg(feature = "blocking")]
pub mod blocking;
mod external;
mod stationsearchbuilder;
mod countrysearchbuilder;
mod languagesearchbuilder;
mod tagsearchbuilder;
mod structs;

pub use api::RadioBrowserAPI;
pub use structs::ApiConfig;
pub use structs::ApiCountry;
pub use structs::ApiLanguage;
pub use structs::ApiStation;
pub use structs::ApiStreamingServer;
pub use structs::ApiStationClick;
pub use structs::ApiStationHistory;
pub use structs::ApiTag;
pub use structs::ApiStatus;
pub use structs::ApiStationAddResult;
pub use structs::ApiStationClickResult;
pub use structs::ApiStationVoteResult;
pub use stationsearchbuilder::StationSearchBuilder;
pub use stationsearchbuilder::StationOrder;
pub use countrysearchbuilder::CountrySearchBuilder;
pub use countrysearchbuilder::CountryOrder;
pub use languagesearchbuilder::LanguageSearchBuilder;
pub use languagesearchbuilder::LanguageOrder;
pub use tagsearchbuilder::TagSearchBuilder;
pub use tagsearchbuilder::TagOrder;