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:
10
src/error.rs
10
src/error.rs
@@ -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)
|
||||
|
Reference in New Issue
Block a user