diff options
Diffstat (limited to 'tests/generated/packet_decl_array_with_padding_little_endian.rs')
-rw-r--r-- | tests/generated/packet_decl_array_with_padding_little_endian.rs | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/tests/generated/packet_decl_array_with_padding_little_endian.rs b/tests/generated/packet_decl_array_with_padding_little_endian.rs index bd1aae0..6aee602 100644 --- a/tests/generated/packet_decl_array_with_padding_little_endian.rs +++ b/tests/generated/packet_decl_array_with_padding_little_endian.rs @@ -4,7 +4,7 @@ use bytes::{Buf, BufMut, Bytes, BytesMut}; use std::convert::{TryFrom, TryInto}; use std::cell::Cell; use std::fmt; -use thiserror::Error; +use pdl_runtime::{Error, Packet}; type Result<T> = std::result::Result<T, Error>; /// Private prevents users from creating arbitrary scalar values /// in situations where the value needs to be validated. @@ -18,31 +18,6 @@ impl<T> std::ops::Deref for Private<T> { &self.0 } } -#[derive(Debug, Error)] -pub enum Error { - #[error("Packet parsing failed")] - InvalidPacketError, - #[error("{field} was {value:x}, which is not known")] - ConstraintOutOfBounds { field: String, value: u64 }, - #[error("Got {actual:x}, expected {expected:x}")] - InvalidFixedValue { expected: u64, actual: u64 }, - #[error("when parsing {obj} needed length of {wanted} but got {got}")] - InvalidLengthError { obj: String, wanted: usize, got: usize }, - #[error( - "array size ({array} bytes) is not a multiple of the element size ({element} bytes)" - )] - InvalidArraySize { array: usize, element: usize }, - #[error("Due to size restrictions a struct could not be parsed.")] - ImpossibleStructError, - #[error("when parsing field {obj}.{field}, {value} is not a valid {type_} value")] - InvalidEnumValueError { obj: String, field: String, value: u64, type_: String }, - #[error("expected child {expected}, got {actual}")] - InvalidChildError { expected: &'static str, actual: String }, -} -pub trait Packet { - fn to_bytes(self) -> Bytes; - fn to_vec(self) -> Vec<u8>; -} #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Foo { |