pub(crate) fn pack_str(mut msg: Vec<u8>, field: &str) -> Result<Vec<u8>, Error> {
    let l = field.len();
    if l > 255 {
        return Err(ERR_STRING_TOO_LONG.to_owned());
    }
    msg.push(l as u8);
    msg.extend_from_slice(field.as_bytes());
    Ok(msg)
}
// pack_text appends the wire format of field to msg.
pack_text appends the wire format of field to msg.
pack_text appends the wire format of field to msg .
pub(crate) fn pack_str(mut msg: Vec<u8>, field: &str) -> Result<Vec<u8>, Error> {
    let l = field.len();
    if l > 255 {
        return Err(ERR_STRING_TOO_LONG.to_owned());
    }
    msg.push(l as u8);
    msg.extend_from_slice(field.as_bytes());
    Ok(msg)
}
pub ( crate ) fn pack_str ( mut msg : Vec < u8 > , field : & str ) -> Result < Vec < u8 > , Error > { let l = field . len ( ) ; if l > 255 { return Err ( ERR_STRING_TOO_LONG . to_owned ( ) ) ; } msg . push ( l as u8 ) ; msg . extend_from_slice ( field . as_bytes ( ) ) ; Ok ( msg ) }
pack_text appends the wire format of field to msg.
pack_text appends the wire format of field to msg .
msg
Vec<u8>
field
&str
msg
Vec<u8>
field
&str