ancillary data size and doc improvement#88425
ancillary data size and doc improvement#88425beroal wants to merge 2 commits intorust-lang:masterfrom beroal:master
Conversation
|
It appears that LinkTed isn't a team member, and thus highfive wouldn't assign this to them. In the interest of having it assigned to someone... r? @the8472 |
|
|
||
| impl<'a> SocketAncillary<'a> { | ||
| /// Create an ancillary data with the given buffer. | ||
| /// Create a struct for accessing an ancillary data packet in `buffer`. |
There was a problem hiding this comment.
accessing [...] in buffer
While this isn't wrong I think it could be misunderstood that the purpose of this constructor is to pass in a buffer that already contains messages and then deserializing it.
The next sentence clarifies it but I think we can still do better. Maybe something like
Create a struct holding ancillary data.
bufferis used to store the serialized data without dynamic allocations.
Exposing the buffer is mostly an optimization to play nice with low-level network code that uses preallocated buffers.
There was a problem hiding this comment.
I'm trying to avoid saying that the struct holds ancillary data because it doesn't.
There was a problem hiding this comment.
Create a struct to process ancillary data.
bufferis used to store the serialized data without dynamic allocations.
| } | ||
|
|
||
| /// A Unix socket Ancillary data struct. | ||
| /// A struct for accessing a socket ancillary data packet. |
| /// let mut ancillary_buffer = [0; 128]; | ||
| /// let mut ancillary = SocketAncillary::new(&mut ancillary_buffer[..]); | ||
| /// ``` | ||
| // FIXME: add size example |
There was a problem hiding this comment.
This is meant for a future PR or is this PR incomplete?
|
Ping from triage: |
I can't finish this PR now. |
|
Triage: |
Functions calculating the size of a control message. Improvement of the doc for
SocketAncillaryand the main doc. Clarification thatadd_fdsandadd_credsadd one control message.r? @LinkTed