Add types for inspecting control messages in Unix socket ancillary data#117196
Closed
jmillikin wants to merge 1 commit intorust-lang:masterfrom
Closed
Add types for inspecting control messages in Unix socket ancillary data#117196jmillikin wants to merge 1 commit intorust-lang:masterfrom
jmillikin wants to merge 1 commit intorust-lang:masterfrom
Conversation
Collaborator
|
r? @cuviper (rustbot has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
15d4daf to
f50a22f
Compare
Contributor
Author
|
@rustbot label +T-libs-api -T-libs |
Member
|
r? libs-api |
This comment has been minimized.
This comment has been minimized.
f50a22f to
bd2eea0
Compare
Member
|
Reassigning to Josh, who has opinions about the existing ancillary data API and the proposed one. r? joshtriplett |
1cdcf8a to
fc50372
Compare
Contributor
Author
|
CI is green now (having done its job of reminding me that UI tests exist...) |
fc50372 to
d160774
Compare
d160774 to
10f6389
Compare
Contributor
Author
|
Note: the most recent iteration of the RFC doesn't require |
Member
|
r? libs-api |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Tracking issue: #76915
RFC for
unix_socket_ancillary_dataredesign: rust-lang/rfcs#3430The portion of the new API dealing with control message inspection seems to be non-contentious, so this PR implements it. The types and logic are all separate from the current implementation, so they can co-exist without worries about compatibility or unexpected behavior changes.
New types:
ControlMessage<'a>is a borrowed reference to a single control message. No inspection of the message content, just the generic metadata (cmsg_level,cmsg_type) and data slice.&ControlMessagesis a wrapper around&[u8]that has aniter() -> ControlMessagesItermethod.ControlMessagesIter<'a>iterates over control messages by inspectingcmsg_lenIncludes docs and tests.