2 unstable releases

Uses old Rust 2015

0.2.0 May 15, 2017
0.1.0 May 15, 2017

#52 in #admin

LGPL-3.0

11KB
311 lines

cjdns-rs Build Status Crates.io

Admin API implementation of cjdns.

Getting started

extern crate cjdns;

use cjdns::structs::Peer;

fn main() {
    let sock = cjdns::Socket::udp("127.0.0.1:11234").unwrap();

    let x = sock.ping().unwrap();
    println!("{:?}", x);

    let x = sock.peer_stats().unwrap();
    let peers: Vec<Peer> = x.into_iter()
                            .flat_map(|page| page.peers)
                            .collect();
    for peer in peers {
        println!("{:?}", peer);
    }
}

License

LGPLv3


lib.rs:

Admin API implementation of cjdns

Example

extern crate cjdns;

use cjdns::structs::Peer;

fn main() {
let sock = cjdns::Socket::udp("127.0.0.1:11234").unwrap();

let x = sock.ping().unwrap();
println!("{:?}", x);

let x = sock.peer_stats().unwrap();
let peers: Vec<Peer> = x.into_iter()
.flat_map(|page| page.peers)
.collect();
for peer in peers {
println!("{:?}", peer);
}
}

Dependencies

~665KB
~13K SLoC