Skip to content

Commit c67e99b

Browse files
committed
Mention the write_all issue in the main EncoderWriter documentation
1 parent a21202e commit c67e99b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/write/encoder.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ const MIN_ENCODE_CHUNK_SIZE: usize = 3;
5353
///
5454
/// It has some minor performance loss compared to encoding slices (a couple percent).
5555
/// It does not do any heap allocation.
56+
///
57+
/// # Limitations
58+
///
59+
/// Owing to the specification of the `write` and `flush` methods on the `Write` trait and their
60+
/// implications for a buffering implementation, these methods may not behave as expected. In
61+
/// particular, calling `write_all` on this interface may fail with `io::ErrorKind::WriteZero`.
62+
/// See the documentation of the `Write` trait implementation for further details.
5663
pub struct EncoderWriter<W: Write> {
5764
config: Config,
5865
/// Where encoded data is written to. It's an Option as it's None immediately before Drop is

0 commit comments

Comments
 (0)