1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 00:50:20 +02:00

Add HttpMessage::readlines()

This commit is contained in:
Dursun Akkurt
2018-06-14 00:19:48 +03:00
parent 1bee528018
commit cb77f7e688
3 changed files with 64 additions and 32 deletions

View File

@@ -592,9 +592,13 @@ impl From<JsonError> for JsonPayloadError {
/// Error type returned when reading body as lines.
pub enum ReadlinesError {
/// Error when decoding a line.
EncodingError,
/// Payload error.
PayloadError(PayloadError),
/// Line limit exceeded.
LimitOverflow,
/// ContentType error.
ContentTypeError(ContentTypeError),
}
@@ -604,12 +608,6 @@ impl From<PayloadError> for ReadlinesError {
}
}
impl From<Error> for ReadlinesError {
fn from(_: Error) -> Self {
ReadlinesError::EncodingError
}
}
impl From<ContentTypeError> for ReadlinesError {
fn from(err: ContentTypeError) -> Self {
ReadlinesError::ContentTypeError(err)