mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-26 10:27:42 +02:00
fix doctest ci (#188)
This commit is contained in:
@ -7,10 +7,9 @@ authors = [
|
||||
"Yuki Okushi <huyuumi.dev@gmail.com>"
|
||||
]
|
||||
description = "Protobuf support for Actix web"
|
||||
readme = "README.md"
|
||||
keywords = ["actix", "protobuf", "protocol", "rpc"]
|
||||
homepage = "https://actix.rs"
|
||||
repository = "https://github.com/actix/actix-extras.git"
|
||||
repository = "https://github.com/actix/actix-extras"
|
||||
license = "MIT OR Apache-2.0"
|
||||
exclude = [".cargo/config", "/examples/**"]
|
||||
|
||||
@ -20,7 +19,7 @@ path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
actix-rt = "2"
|
||||
actix-web = { version = "4.0.0-beta.5", default_features = false }
|
||||
actix-web = { version = "4.0.0-beta.8", default_features = false }
|
||||
derive_more = "0.99.5"
|
||||
futures-util = { version = "0.3.7", default-features = false }
|
||||
prost = "0.7"
|
||||
|
@ -8,7 +8,7 @@ authors = [
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
actix-web = "4.0.0-beta.5"
|
||||
actix-web = "4.0.0-beta.8"
|
||||
actix-protobuf = { path = "../../" }
|
||||
|
||||
env_logger = "0.8"
|
||||
|
@ -1,39 +1,49 @@
|
||||
#![deny(rust_2018_idioms)]
|
||||
#![forbid(unsafe_code)]
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
|
||||
use std::{
|
||||
fmt,
|
||||
future::Future,
|
||||
ops::{Deref, DerefMut},
|
||||
pin::Pin,
|
||||
task::{self, Poll},
|
||||
};
|
||||
|
||||
use actix_web::{
|
||||
dev::Payload,
|
||||
error::PayloadError,
|
||||
http::header::{CONTENT_LENGTH, CONTENT_TYPE},
|
||||
web::BytesMut,
|
||||
Error, FromRequest, HttpMessage, HttpRequest, HttpResponse, HttpResponseBuilder,
|
||||
Responder, ResponseError,
|
||||
};
|
||||
use derive_more::Display;
|
||||
use std::fmt;
|
||||
use std::future::Future;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::pin::Pin;
|
||||
use std::task;
|
||||
use std::task::Poll;
|
||||
|
||||
use prost::DecodeError as ProtoBufDecodeError;
|
||||
use prost::EncodeError as ProtoBufEncodeError;
|
||||
use prost::Message;
|
||||
|
||||
use actix_web::dev::{HttpResponseBuilder, Payload};
|
||||
use actix_web::error::{Error, PayloadError, ResponseError};
|
||||
use actix_web::http::header::{CONTENT_LENGTH, CONTENT_TYPE};
|
||||
use actix_web::web::BytesMut;
|
||||
use actix_web::{FromRequest, HttpMessage, HttpRequest, HttpResponse, Responder};
|
||||
use futures_util::future::{FutureExt, LocalBoxFuture};
|
||||
use futures_util::StreamExt;
|
||||
use futures_util::{
|
||||
future::{FutureExt as _, LocalBoxFuture},
|
||||
stream::StreamExt as _,
|
||||
};
|
||||
use prost::{
|
||||
DecodeError as ProtoBufDecodeError, EncodeError as ProtoBufEncodeError, Message,
|
||||
};
|
||||
|
||||
#[derive(Debug, Display)]
|
||||
pub enum ProtoBufPayloadError {
|
||||
/// Payload size is bigger than 256k
|
||||
#[display(fmt = "Payload size is bigger than 256k")]
|
||||
Overflow,
|
||||
|
||||
/// Content type error
|
||||
#[display(fmt = "Content type error")]
|
||||
ContentType,
|
||||
|
||||
/// Serialize error
|
||||
#[display(fmt = "ProtoBuf serialize error: {}", _0)]
|
||||
Serialize(ProtoBufEncodeError),
|
||||
|
||||
/// Deserialize error
|
||||
#[display(fmt = "ProtoBuf deserialize error: {}", _0)]
|
||||
Deserialize(ProtoBufDecodeError),
|
||||
|
||||
/// Payload error
|
||||
#[display(fmt = "Error that occur during reading payload: {}", _0)]
|
||||
Payload(PayloadError),
|
||||
|
Reference in New Issue
Block a user