1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-22 01:21:10 +00:00

docs(multipart): doc PayloadBuffer::readline

This commit is contained in:
Rob Ede 2024-07-07 20:19:56 +01:00
parent e9ccfbc866
commit 16125bd3be
No known key found for this signature in database
GPG key ID: 97C636207D3EF933

View file

@ -122,7 +122,13 @@ impl PayloadBuffer {
}
}
/// Reads bytes until new line delimiter.
/// Reads bytes until new line delimiter (`\n`, `0x0A`).
///
/// Returns:
///
/// - `Ok(Some(chunk))` - `needle` is found, with chunk ending after needle
/// - `Err(Incomplete)` - `needle` is not found and we're at EOF
/// - `Ok(None)` - `needle` is not found otherwise
#[inline]
pub(crate) fn readline(&mut self) -> Result<Option<Bytes>, Error> {
self.read_until(b"\n")