pub fn ensure_bytes(&mut self, sample: &bytes::Bytes) -> Hopefully<()>
  {
    let actual = self.read_bytes(sample.len()).unwrap();

    let b2 = sample.as_ref();
    if actual.as_slice() == b2 { return Ok(()); }

    let msg = format!("{}Expected: {:?} actual {:?}",
                      module(), sample, actual);
    Err(ReadError::ReadFailed(msg))
  }
/// From the buffer take so many bytes as there are in `sample` and compare
/// them.
From the buffer take so many bytes as there are in `sample` and compare
them.
From the buffer take so many bytes as there are in ` sample ` and compare them .
pub fn ensure_bytes(&mut self, sample: &bytes::Bytes) -> Hopefully<()>
  {
    let actual = self.read_bytes(sample.len()).unwrap();
    let b2 = sample.as_ref();
    if actual.as_slice() == b2 { return Ok(()); }
    let msg = format!("{}Expected: {:?} actual {:?}",
                      module(), sample, actual);
    Err(ReadError::ReadFailed(msg))
  }
pub fn ensure_bytes ( & mut self , sample : & bytes :: Bytes ) -> Hopefully < ( ) > { let actual = self . read_bytes ( sample . len ( ) ) . unwrap ( ) ; let b2 = sample . as_ref ( ) ; if actual . as_slice ( ) == b2 { return Ok ( ( ) ) ; } let msg = format ! ( " " module ( ) sample actual ) ; Err ( ReadError :: ReadFailed ( msg ) ) }
From the buffer take so many bytes as there are in `sample` and compare
them.
From the buffer take so many bytes as there are in ` sample ` and compare them .
&mut self
sample
&bytes::Bytes