pub fn read_rr(&mut self) -> Result<ReadRr<'a>> {
        let (owner, owner_len) =
            Name::try_from_compressed(self.octets, self.cursor).map_err(Error::InvalidOwner)?;
        let owner_end = self.cursor + owner_len;
        let rr_type = read_u16(&self.octets[owner_end..])?.into();
        let class = read_u16(&self.octets[owner_end + 2..])?.into();
        let ttl = read_u32(&self.octets[owner_end + 4..])?.into();
        let rdlength = read_u16(&self.octets[owner_end + 8..])?;
        let rdata = Rdata::read(rr_type, self.octets, self.cursor + owner_len + 10, rdlength)?;
        self.cursor += owner_len + 10 + rdlength as usize;
        Ok(ReadRr {
            owner,
            rr_type,
            class,
            ttl,
            rdata,
        })
    }
/// Reads a resource record at the current cursor.
///
/// This method is atomic, in that the cursor is not changed on
/// failure.
Reads a resource record at the current cursor.
This method is atomic, in that the cursor is not changed on
failure.
Reads a resource record at the current cursor . This method is atomic in that the cursor is not changed on failure .
pub fn read_rr(&mut self) -> Result<ReadRr<'a>> {
        let (owner, owner_len) =
            Name::try_from_compressed(self.octets, self.cursor).map_err(Error::InvalidOwner)?;
        let owner_end = self.cursor + owner_len;
        let rr_type = read_u16(&self.octets[owner_end..])?.into();
        let class = read_u16(&self.octets[owner_end + 2..])?.into();
        let ttl = read_u32(&self.octets[owner_end + 4..])?.into();
        let rdlength = read_u16(&self.octets[owner_end + 8..])?;
        let rdata = Rdata::read(rr_type, self.octets, self.cursor + owner_len + 10, rdlength)?;
        self.cursor += owner_len + 10 + rdlength as usize;
        Ok(ReadRr {
            owner,
            rr_type,
            class,
            ttl,
            rdata,
        })
    }
pub fn read_rr ( & mut self ) -> Result < ReadRr < ' a > > { let ( owner , owner_len ) = Name :: try_from_compressed ( self . octets , self . cursor ) . map_err ( Error :: InvalidOwner ) ? ; let owner_end = self . cursor + owner_len ; let rr_type = read_u16 ( & self . octets [ owner_end .. ] ) ? . into ( ) ; let class = read_u16 ( & self . octets [ owner_end + 2 .. ] ) ? . into ( ) ; let ttl = read_u32 ( & self . octets [ owner_end + 4 .. ] ) ? . into ( ) ; let rdlength = read_u16 ( & self . octets [ owner_end + 8 .. ] ) ? ; let rdata = Rdata :: read ( rr_type , self . octets , self . cursor + owner_len + 10 , rdlength ) ? ; self . cursor += owner_len + 10 + rdlength as usize ; Ok ( ReadRr { owner , rr_type , class , ttl , rdata , } ) }
Reads a resource record at the current cursor.
Reads a resource record at the current cursor .
&mut self
&mut self