-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing magic changed to be a unique error vs a parsing error #440
base: master
Are you sure you want to change the base?
Conversation
…arsers for framing data from streams is easier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Check the CI, there are some other errors.
Will do! Shoulda marked this as a draft while I was working on that, apologies. |
What version of the toolchain is being used, compiler outputs being used for tests without pinning a version is what's causing some of these CI failures. I had been on a nightly 1.80 which apparently changes the output of the compiler, fun fun! |
Yah I usually use |
/// Deku errors | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
#[non_exhaustive] | ||
pub enum DekuError { | ||
/// Parsing error when reading | ||
Incomplete(NeedSize), | ||
/// Failed to find magic | ||
Framing(NeedMagic), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would prefer the name relate to magic, unless we plan on expanding this to be an enum with different variants
This change is needed so parsers that work on stream data can know wether to advance into the buffer to find a valid message without having to manually search for magic bytes before feeding the DekuRead object.