Crates.io | lbry-rs |
lib.rs | lbry-rs |
version | 0.0.1 |
source | src |
created_at | 2019-04-21 14:00:14.062433 |
updated_at | 2019-04-21 14:00:14.062433 |
description | A Rust API wrapper for lbrynet |
homepage | https://github.com/zxawry/lbry-rs |
repository | https://github.com/zxawry/lbry-rs |
max_upload_size | |
id | 129250 |
size | 5,501 |
A Rust API wrapper for lbrynet
Cargo.toml
dependencieslbry-rs = "0.0.1"
$ git clone https://github.com/zxawry/lbry-rs
Cargo.toml
dependencieslbry-rs = {path = "{path-to-where-you-cloned-the-repository}"}
extern crate lbry_rs;
use lbry_rs::LbrynetApi;
//re-exported from serde_json
use lbry_rs::{Value, json};
fn main() {
//instantiate a lbry client
let mut lbry = LbrynetApi::new();
//make requests by providing the method and params with cURL command-line syntax
//params must be of the type serde_json::Value so use json! macro for conversion
let result0: Value = lbry.call("status", json!({}));
let result1: Value = lbry.call("resolve", json!({"urls":"lbrytv"}));
println!("{}", result0);
println!("{}", result1);
}
Note that lbrynet
must be up and running, to use this API wrapper.
MIT License