continue metadata PDU tests

This commit is contained in:
2023-05-29 01:29:04 +02:00
parent 6865898102
commit e13183764e
4 changed files with 126 additions and 63 deletions

View File

@@ -126,6 +126,10 @@ impl UnsignedByteField {
Self { width, value }
}
pub fn value(&self) -> u64 {
self.value
}
pub fn new_from_be_bytes(width: usize, buf: &[u8]) -> Result<Self, UnsignedByteFieldError> {
if width > buf.len() {
return Err(ByteConversionError::FromSliceTooSmall(SizeMissmatch {