Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/OpenSourceOrg/rust-opensource
Rust API Bindings to the OSI License API
https://github.com/OpenSourceOrg/rust-opensource
api api-client library opensource rust
Last synced: about 2 months ago
JSON representation
Rust API Bindings to the OSI License API
- Host: GitHub
- URL: https://github.com/OpenSourceOrg/rust-opensource
- Owner: OpenSourceOrg
- License: bsd-3-clause
- Created: 2016-06-19T16:40:46.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-04-05T14:27:25.000Z (over 4 years ago)
- Last Synced: 2024-05-01T11:36:12.786Z (5 months ago)
- Topics: api, api-client, library, opensource, rust
- Language: Rust
- Size: 569 KB
- Stars: 6
- Watchers: 11
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
`rust-opensource` is an API Wrapper that allows you to query the Open Source
License API with Rust.## Install ##
The crate is called `opensource` and you can depend on it via cargo:
```ini
[dependencies]
opensource = "0.2.0"
```Documentation can be found at
[OpenSourceOrg.github.io/rust-opensource](https://OpenSourceOrg.github.io/rust-opensource).# Examples #
```rust
extern crate opensource;use opensource::client;
fn main() {
let license = client::get("BSD-3").unwrap();
println!("{}", license.name);
}
```A better way is to use match:
```rust
extern crate opensource;use opensource::client;
fn main() {
let license = client::get("this-license-does-not-exist");
match license {
Ok(license) => println!("{}", license.name),
Err(err) => println!("{}", err),
}
}
```