radiobrowser-lib-rust/README.md

36 lines
729 B
Markdown
Raw Normal View History

2022-04-18 21:56:20 +00:00
# Radiobrowser Lib Rust
Client library for radio-browser.info and other radio-browser-rust servers
## Getting started
2022-04-21 20:59:15 +00:00
Cargo.toml entry
```toml
radiobrowser = "*"
2022-04-18 21:56:20 +00:00
```
2022-04-21 20:59:15 +00:00
Example:
```rust
use radiobrowser::RadioBrowserAPI;
use radiobrowser::StationOrder;
use std::error::Error;
#[async_std::main]
async fn main() -> Result<(), Box<dyn Error>> {
let mut api = RadioBrowserAPI::new().await?;
let stations = api
.get_stations()
.name("jazz")
.reverse(true)
.order(StationOrder::Clickcount)
2022-04-21 21:03:49 +00:00
.send()
.await?;
2022-04-21 20:59:15 +00:00
println!("Stations found: {}", stations?.len());
Ok(())
}
2022-04-18 21:56:20 +00:00
```
## Usage
2022-04-21 20:59:15 +00:00
Documentation is at https://docs.rs/radiobrowser
2022-04-18 21:56:20 +00:00
## License
2022-04-21 20:59:15 +00:00
This project is MIT licensed.