Add an UnknownEnum error type, make KaitaiStruct optional for parents

master
Bradlee Speice 2019-04-22 12:01:01 -04:00
parent 7d297b884a
commit f9ae7b76cb
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ use std::io;
pub enum KaitaiError<'a> {
InvalidContents { actual: &'a [u8] },
IoError(io::Error),
UnknownEnum(u64),
}
impl<'a> From<io::Error> for KaitaiError<'a> {
@ -15,7 +16,7 @@ impl<'a> From<io::Error> for KaitaiError<'a> {
pub type Result<'a, T> = std::result::Result<T, KaitaiError<'a>>;
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,