Allow nested parsers on MessageProducer level (v4) #2087
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR isn't for to be merged. It's a suggestion in the scope of work on #2073, #2078 and #2084
It provides the basic implementation for #2071 on parser level.
ParseRestResolver
implemented to provide methods to parse a given chunks of bytes with a hint about how to parse those bytes.LogMessage
doesn't implement Display anymore. Instead, it has the methodtry_resolve(&self, resolver: Option<&mut ParseRestResolver>) -> Result<impl Display, ...>
to try to parse the message using the provided resolver if possible and returning an error to express the case when parsing fails.ParseLogMsgError
is defined with methods to parse the messages lossy (replace none-parsed bytes with their byte representation), besides the severity of the error and an error message to be used to collect the errors for proper error handling of parse log messages (as mentions in Consider Errors while parsing messages payload #2071)LogMessage
has and associated error type which implement ParseLogMsgError, giving a chance for parser which never fails to provide Infallible Error type, to tell the compiler that this types will never error for compile time optimizations. Parser that can fail can use the structGeneralParseLogError
which implements the traitParseLogMsgError
.