mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-25 18:09:22 +02:00
handler info
This commit is contained in:
19
src/route.rs
19
src/route.rs
@ -67,6 +67,7 @@ impl Reply {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(actix_nightly))]
|
||||
impl<T: Into<HttpResponse>> From<T> for Reply
|
||||
{
|
||||
fn from(item: T) -> Self {
|
||||
@ -74,6 +75,24 @@ impl<T: Into<HttpResponse>> From<T> for Reply
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(actix_nightly)]
|
||||
default impl<T: Into<HttpResponse>> From<T> for Reply
|
||||
{
|
||||
fn from(item: T) -> Self {
|
||||
Reply(ReplyItem::Message(item.into()))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(actix_nightly)]
|
||||
default impl<T: Into<HttpResponse>, E: Into<Error>> From<StdResult<T, E>> for Reply {
|
||||
fn from(res: StdResult<T, E>) -> Self {
|
||||
match res {
|
||||
Ok(val) => val.into().into(),
|
||||
Err(err) => err.into().into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: Into<Error>> From<StdResult<Reply, E>> for Reply {
|
||||
fn from(res: StdResult<Reply, E>) -> Self {
|
||||
match res {
|
||||
|
Reference in New Issue
Block a user