fn validate_character_string(octets: &[u8]) -> Result<usize, ReadRdataError> {
    if let Some(len) = octets.get(0) {
        let wire_len = 1 + *len as usize;
        if wire_len <= octets.len() {
            Ok(wire_len)
        } else {
            Err(ReadRdataError::Other)
        }
    } else {
        Err(ReadRdataError::Other)
    }
}
/// Validates the on-the-wire representation of a `<character-string>`
/// at the beginning of the provided buffer, returning the length of the
/// string on the wire when successful.
Validates the on-the-wire representation of a ``
at the beginning of the provided buffer, returning the length of the
string on the wire when successful.
Validates the on - the - wire representation of a ` ` at the beginning of the provided buffer returning the length of the string on the wire when successful .
fn validate_character_string(octets: &[u8]) -> Result<usize, ReadRdataError> {
    if let Some(len) = octets.get(0) {
        let wire_len = 1 + *len as usize;
        if wire_len <= octets.len() {
            Ok(wire_len)
        } else {
            Err(ReadRdataError::Other)
        }
    } else {
        Err(ReadRdataError::Other)
    }
}
fn validate_character_string ( octets : & [ u8 ] ) -> Result < usize , ReadRdataError > { if let Some ( len ) = octets . get ( 0 ) { let wire_len = 1 + * len as usize ; if wire_len <= octets . len ( ) { Ok ( wire_len ) } else { Err ( ReadRdataError :: Other ) } } else { Err ( ReadRdataError :: Other ) } }
Validates the on-the-wire representation of a `<character-string>`
at the beginning of the provided buffer, returning the length of the
string on the wire when successful.
Validates the on - the - wire representation of a ` <character - string > ` at the beginning of the provided buffer returning the length of the string on the wire when successful .
octets
&[u8]
octets
&[u8]