Skip to content

Commit

Permalink
review feedback: fn iter() + impl Extend, other fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmillikin committed Oct 21, 2023
1 parent fda7369 commit 5cb2f2e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions text/3430-unix-socket-ancillary-data-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fn send_file(stream: &UnixStream, file: std::fs::File) -> std::io::Result<()> {

MessageSender::new(stream, b"\x00")
.ancillary_data(&mut ancillary)
.send(&stream)?;
.send()?;
Ok(())
}
```
Expand All @@ -121,7 +121,7 @@ fn recv_file(stream: &UnixStream) -> std::io::Result<std::fs::File> {
let mut buf = [0u8; 1];
MessageReceiver::new(stream, &mut buf)
.ancillary_data(&mut ancillary)
.recv(&stream)?;
.recv()?;

// TODO: error handling (std::io::Error if not enough FDs returned)
let mut owned_fds = ancillary.take_owned_fds().unwrap();
Expand Down Expand Up @@ -172,6 +172,7 @@ impl ControlMessages {
fn as_bytes(&self) -> &[u8];
fn is_empty(&self) -> bool;
fn len(&self) -> usize;
fn iter(&self) -> ControlMessagesIter<'_>;
}

impl<'a> IntoIterator for &'a ControlMessages {
Expand Down Expand Up @@ -230,6 +231,8 @@ impl<'a> IntoIterator for &'a ControlMessagesBuf {
type Item = ControlMessage<'a>;
type IntoIter = ControlMessagesIter<'a>;
}

impl Extend<ControlMessage<'_>> for ControlMessagesBuf;
```

## Ancillary data
Expand Down

0 comments on commit 5cb2f2e

Please sign in to comment.