rust: rename items in linear reader #1341
Merged
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.
Changelog
mcap::sans_io::read
tomcap::sans_io::linear_reader
.mcap::sans_io::read::ReadAction
tomcap::sans_io::linear_reader::LinearReadEvent
LinearReader::next_action()
toLinearReader::next_event()
.LinearReader::set_written()
toLinearReader::notify_read()
.mcap::tokio::read::RecordReader
tomcap::tokio::linear_reader::LinearReader
Docs
Changes are reflected in
cargo doc
.Description
This PR revises the names of functions and structs exposed from the
sans_io
module, because they're badly named as-is and we need to fix this now before we add more to this module.Specifically:
ReadAction
gets renamed toLinearReadEvent
. This is because there's no definition of "action" in this context that makes sense - NeedMore is not an action. NeedMore is requesting the caller take some action, but then GetMessage is not requesting the caller to do anything. "events" are a term more commonly used in other parsers such as SAX, and can be interpreted more generally.set_written()
is renamed tonotify_read()
. This better reflects what it's for (notifying the reader of the result of a read), and I found the termwritten
confusing on a struct meant to be used for reading.tokio::RecordReader
is renamed to LinearReader for consistency.sans_io::read
module is renamed tolinear_reader
- This better reflects its contents. When we add more readers to the sans_io module, I don't intend to add them all to thesans_io::read
module, it doesn't help anyone to nest so deeply.