From f9ae7b76cb2092290da03ccb8fd14f6ab91cca89 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Mon, 22 Apr 2019 12:01:01 -0400 Subject: [PATCH] Add an UnknownEnum error type, make KaitaiStruct optional for parents --- src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 8002a3f..71dd749 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,6 +4,7 @@ use std::io; pub enum KaitaiError<'a> { InvalidContents { actual: &'a [u8] }, IoError(io::Error), + UnknownEnum(u64), } impl<'a> From for KaitaiError<'a> { @@ -15,7 +16,7 @@ impl<'a> From for KaitaiError<'a> { pub type Result<'a, T> = std::result::Result>; pub trait KaitaiStruct<'a> { - type Parent: KaitaiStruct<'a>; + type Parent: ?KaitaiStruct<'a>; type Root: KaitaiStruct<'a>; /// Create a new instance of this struct; if we are the root node,