pub fn add_question(&mut self, question: &Question) -> Result<()> {
        if self.section != Section::Question {
            Err(Error::OutOfOrder)
        } else if let Some(new_qdcount) = self.qdcount.checked_add(1) {
            self.with_rollback(|this| {
                this.try_push(question.qname.wire_repr())?;
                this.try_push_u16(question.qtype.into())?;
                this.try_push_u16(question.qclass.into())
            })?;
            self.qdcount = new_qdcount;
            self.rr_start = self.cursor;
            Ok(())
        } else {
            Err(Error::CountOverflow)
        }
    }
/// Adds a question to message. This must be used before any
/// resource records are added.
Adds a question to message. This must be used before any
resource records are added.
Adds a question to message . This must be used before any resource records are added .
pub fn add_question(&mut self, question: &Question) -> Result<()> {
        if self.section != Section::Question {
            Err(Error::OutOfOrder)
        } else if let Some(new_qdcount) = self.qdcount.checked_add(1) {
            self.with_rollback(|this| {
                this.try_push(question.qname.wire_repr())?;
                this.try_push_u16(question.qtype.into())?;
                this.try_push_u16(question.qclass.into())
            })?;
            self.qdcount = new_qdcount;
            self.rr_start = self.cursor;
            Ok(())
        } else {
            Err(Error::CountOverflow)
        }
    }
pub fn add_question ( & mut self , question : & Question ) -> Result < ( ) > { if self . section != Section :: Question { Err ( Error :: OutOfOrder ) } else if let Some ( new_qdcount ) = self . qdcount . checked_add ( 1 ) { self . with_rollback ( | this | { this . try_push ( question . qname . wire_repr ( ) ) ? ; this . try_push_u16 ( question . qtype . into ( ) ) ? ; this . try_push_u16 ( question . qclass . into ( ) ) } ) ? ; self . qdcount = new_qdcount ; self . rr_start = self . cursor ; Ok ( ( ) ) } else { Err ( Error :: CountOverflow ) } }
Adds a question to message.
Adds a question to message .
&mut self
question
&Question
&mut self
question
&Question