1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-23 16:21:06 +01: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")