lbry-rs

Crates.iolbry-rs
lib.rslbry-rs
version0.0.1
sourcesrc
created_at2019-04-21 14:00:14.062433
updated_at2019-04-21 14:00:14.062433
descriptionA Rust API wrapper for lbrynet
homepagehttps://github.com/zxawry/lbry-rs
repositoryhttps://github.com/zxawry/lbry-rs
max_upload_size
id129250
size5,501
(zxawry)

documentation

https://github.com/zxawry/lbry-rs#usage

README

lbry-rs

A Rust API wrapper for lbrynet

Installation

From crates

  1. Add the following line to your Cargo.toml dependencies
lbry-rs = "0.0.1"

From source

  1. Clone the repository
$ git clone https://github.com/zxawry/lbry-rs
  1. Add the following line to your Cargo.toml dependencies
lbry-rs = {path = "{path-to-where-you-cloned-the-repository}"}

Usage

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.

Links

License

MIT License

Commit count: 10

cargo fmt