pub fn parse<R>(mut reader: R) -> Result<Self, Error>
    where R: Read
  {
    let size: u64 = read_int(&mut reader)?;
    let mut reader = reader.take(size);

    let header = Header::unpack(&mut  reader)?;

    let mut body: Vec<u8> = Vec::with_capacity(size as usize);

    reader.read_to_end(&mut body)?;

    if body.is_empty() {
      return Ok(Response { header, body: None });
    }

    body.shrink_to_fit();

    Ok(Response { header, body: Some(body) })
  }
/// allows you to parse iproto response header.
allows you to parse iproto response header.
allows you to parse iproto response header .
pub fn parse<R>(mut reader: R) -> Result<Self, Error>
    where R: Read
  {
    let size: u64 = read_int(&mut reader)?;
    let mut reader = reader.take(size);
    let header = Header::unpack(&mut  reader)?;
    let mut body: Vec<u8> = Vec::with_capacity(size as usize);
    reader.read_to_end(&mut body)?;
    if body.is_empty() {
      return Ok(Response { header, body: None });
    }
    body.shrink_to_fit();
    Ok(Response { header, body: Some(body) })
  }
pub fn parse < R > ( mut reader : R ) -> Result < Self , Error > where R : Read { let size : u64 = read_int ( & mut reader ) ? ; let mut reader = reader . take ( size ) ; let header = Header :: unpack ( & mut reader ) ? ; let mut body : Vec < u8 > = Vec :: with_capacity ( size as usize ) ; reader . read_to_end ( & mut body ) ? ; if body . is_empty ( ) { return Ok ( Response { header , body : None } ) ; } body . shrink_to_fit ( ) ; Ok ( Response { header , body : Some ( body ) } ) }
allows you to parse iproto response header.
allows you to parse iproto response header .
reader
R
reader
R