pub fn next_label(&mut self) -> Result<(), Error> {
        if self.is_fully_qualified() {
            Err(Error::NullNonTerminal)
        } else if self.wire_repr.is_full() {
            Err(Error::NameTooLong)
        } else {
            self.update_label_len();
            self.label_start = self.wire_repr.len();
            self.label_len = 0;

            // The wire_repr push will not fail because we checked that
            // it is not full. The label_offsets push will not fail
            // because we're checking the validity of the name as we go;
            // in particular, if we reach this point, none of the
            // previous labels written is null. Therefore, we will not
            // have exceeded the maximum number of labels in a name.
            self.wire_repr.push(0);
            self.label_offsets.push(self.label_start as u8);
            Ok(())
        }
    }
/// Finishes the current label and starts a new one. If the current
/// label is null, this fails, since only the last label in a domain
/// name may be null. Likewise, if this makes the domain name too
/// long, this fails. In the error case, the `NameBuilder`'s state
/// remains unchanged.
Finishes the current label and starts a new one. If the current
label is null, this fails, since only the last label in a domain
name may be null. Likewise, if this makes the domain name too
long, this fails. In the error case, the `NameBuilder`'s state
remains unchanged.
Finishes the current label and starts a new one . If the current label is null this fails since only the last label in a domain name may be null . Likewise if this makes the domain name too long this fails . In the error case the ` NameBuilder ` ' s state remains unchanged .
pub fn next_label(&mut self) -> Result<(), Error> {
        if self.is_fully_qualified() {
            Err(Error::NullNonTerminal)
        } else if self.wire_repr.is_full() {
            Err(Error::NameTooLong)
        } else {
            self.update_label_len();
            self.label_start = self.wire_repr.len();
            self.label_len = 0;
            // The wire_repr push will not fail because we checked that
            // it is not full. The label_offsets push will not fail
            // because we're checking the validity of the name as we go;
            // in particular, if we reach this point, none of the
            // previous labels written is null. Therefore, we will not
            // have exceeded the maximum number of labels in a name.
            self.wire_repr.push(0);
            self.label_offsets.push(self.label_start as u8);
            Ok(())
        }
    }
pub fn next_label ( & mut self ) -> Result < ( ) , Error > { if self . is_fully_qualified ( ) { Err ( Error :: NullNonTerminal ) } else if self . wire_repr . is_full ( ) { Err ( Error :: NameTooLong ) } else { self . update_label_len ( ) ; self . label_start = self . wire_repr . len ( ) ; self . label_len = 0 ; // The wire_repr push will not fail because we checked that // it is not full. The label_offsets push will not fail // because we're checking the validity of the name as we go; // in particular, if we reach this point, none of the // previous labels written is null. Therefore, we will not // have exceeded the maximum number of labels in a name. self . wire_repr . push ( 0 ) ; self . label_offsets . push ( self . label_start as u8 ) ; Ok ( ( ) ) } }
Finishes the current label and starts a new one.
Finishes the current label and starts a new one .
&mut self
&mut self