pub fn pack(
        &self,
        mut msg: Vec<u8>,
        compression: &mut Option<HashMap<String, usize>>,
        compression_off: usize,
    ) -> Result<(Vec<u8>, usize), Error> {
        msg = self.name.pack(msg, compression, compression_off)?;
        msg = self.typ.pack(msg);
        msg = self.class.pack(msg);
        msg = pack_uint32(msg, self.ttl);
        let len_off = msg.len();
        msg = pack_uint16(msg, self.length);
        Ok((msg, len_off))
    }
// pack appends the wire format of the ResourceHeader to oldMsg.
//
// lenOff is the offset in msg where the Length field was packed.
pack appends the wire format of the ResourceHeader to oldMsg.
lenOff is the offset in msg where the Length field was packed.
pack appends the wire format of the ResourceHeader to oldMsg . lenOff is the offset in msg where the Length field was packed .
pub fn pack(
        &self,
        mut msg: Vec<u8>,
        compression: &mut Option<HashMap<String, usize>>,
        compression_off: usize,
    ) -> Result<(Vec<u8>, usize), Error> {
        msg = self.name.pack(msg, compression, compression_off)?;
        msg = self.typ.pack(msg);
        msg = self.class.pack(msg);
        msg = pack_uint32(msg, self.ttl);
        let len_off = msg.len();
        msg = pack_uint16(msg, self.length);
        Ok((msg, len_off))
    }
pub fn pack ( & self , mut msg : Vec < u8 > , compression : & mut Option < HashMap < String , usize > > , compression_off : usize , ) -> Result < ( Vec < u8 > , usize ) , Error > { msg = self . name . pack ( msg , compression , compression_off ) ? ; msg = self . typ . pack ( msg ) ; msg = self . class . pack ( msg ) ; msg = pack_uint32 ( msg , self . ttl ) ; let len_off = msg . len ( ) ; msg = pack_uint16 ( msg , self . length ) ; Ok ( ( msg , len_off ) ) }
pack appends the wire format of the ResourceHeader to oldMsg.
pack appends the wire format of the ResourceHeader to oldMsg .
&self
msg
Vec<u8>
compression
&mut Option<HashMap<String, usize>>
compression_off
usize
&self
msg
Vec<u8>
compression
&mut Option<HashMap<String, usize>>
compression_off
usize