Function lamedh_http::request::from_reader[][src]

pub fn from_reader<R>(rdr: R) -> Result<Request, JsonError> where
    R: Read

Deserializes a Request from a Read impl providing JSON events.

Example

use lamedh_http::request::from_reader;
use std::fs::File;
use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
    let request = from_reader(
        File::open("path/to/request.json")?
    )?;
    Ok(println!("{:#?}", request))
}