Skip to content

Document that write_all will not call write if given an empty buffer - #68627

Merged
bors merged 1 commit into
rust-lang:masterfrom
joshtriplett:write-all-none
Jan 29, 2020
Merged

Document that write_all will not call write if given an empty buffer#68627
bors merged 1 commit into
rust-lang:masterfrom
joshtriplett:write-all-none

Conversation

@joshtriplett

Copy link
Copy Markdown
Member

Some types of Write instances have a semantic meaning associated with
writing an empty buffer, such as sending an empty packet. This works
when calling write directly, and supplying an empty buffer. However,
calling write_all on an empty buffer will simply never call write,
because write_all assumes it has no work to do.

Document this behavior, to help prospective users of
datagram-packet-style Write instances.

Some types of Write instances have a semantic meaning associated with
writing an empty buffer, such as sending an empty packet. This works
when calling `write` directly, and supplying an empty buffer. However,
calling `write_all` on an empty buffer will simply never call `write`,
because `write_all` assumes it has no work to do.
Document this behavior, to help prospective users of
datagram-packet-style Write instances.
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 29, 2020
@Dylan-DPC-zz

Copy link
Copy Markdown

@bors r+ rollup

@bors

bors commented Jan 29, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 9bb2a50 has been approved by Dylan-DPC

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 29, 2020
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jan 29, 2020
…n-DPC
Document that write_all will not call write if given an empty buffer
Some types of Write instances have a semantic meaning associated with
writing an empty buffer, such as sending an empty packet. This works
when calling `write` directly, and supplying an empty buffer. However,
calling `write_all` on an empty buffer will simply never call `write`,
because `write_all` assumes it has no work to do.
Document this behavior, to help prospective users of
datagram-packet-style Write instances.
@JohnTitorJohnTitor mentioned this pull request Jan 29, 2020
bors added a commit that referenced this pull request Jan 29, 2020
Rollup of 7 pull requests
Successful merges:
- #67722 (Minor: note how Any is an unsafe trait in SAFETY comments)
- #68586 (Make conflicting_repr_hints a deny-by-default c-future-compat lint)
- #68598 (Fix null synthetic_implementors error)
- #68603 (Changelog: Demonstrate final build-override syntax)
- #68609 (Set lld flavor for MSVC to link.exe)
- #68611 (Correct ICE caused by macros generating invalid spans.)
- #68627 (Document that write_all will not call write if given an empty buffer)
Failed merges:
r? @ghost
@bors
bors merged commit 9bb2a50 into rust-lang:masterJan 29, 2020
@joshtriplett
joshtriplett deleted the write-all-none branch August 12, 2025 20:13
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@joshtriplett@rust-highfive@Dylan-DPC-zz@bors@alexcrichton