p2p 0.6.0

NAT Traversal for P2P communication
1
2
3
4
5
6
7
8
9
10
11
12
13
14
pub mod event_loop;
pub mod types;

use serde::de::DeserializeOwned;
use serde_json;
use std::fs::File;
use std::io::Read;

pub fn read_config<T: DeserializeOwned>(path: &str) -> T {
    let mut file = unwrap!(File::open(path));
    let mut content = String::new();
    unwrap!(file.read_to_string(&mut content));
    unwrap!(serde_json::from_str(&content))
}