Skip to content

Commit 16125bd

Browse files
committed
docs(multipart): doc PayloadBuffer::readline
1 parent e9ccfbc commit 16125bd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

actix-multipart/src/payload.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,13 @@ impl PayloadBuffer {
122122
}
123123
}
124124

125-
/// Reads bytes until new line delimiter.
125+
/// Reads bytes until new line delimiter (`\n`, `0x0A`).
126+
///
127+
/// Returns:
128+
///
129+
/// - `Ok(Some(chunk))` - `needle` is found, with chunk ending after needle
130+
/// - `Err(Incomplete)` - `needle` is not found and we're at EOF
131+
/// - `Ok(None)` - `needle` is not found otherwise
126132
#[inline]
127133
pub(crate) fn readline(&mut self) -> Result<Option<Bytes>, Error> {
128134
self.read_until(b"\n")

0 commit comments

Comments
 (0)