mirror of https://github.com/rwf2/Rocket.git
impl Responder for Arc<R>
This commit is contained in:
parent
d36687c136
commit
0bf58c7a02
|
@ -1,6 +1,7 @@
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::Cursor;
|
use std::io::Cursor;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
use http::{Status, ContentType};
|
use http::{Status, ContentType};
|
||||||
use response::Response;
|
use response::Response;
|
||||||
|
@ -202,6 +203,13 @@ impl<'r> Responder<'r> for String {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'r,R: Responder<'r>> Responder<'r> for Arc<R> {
|
||||||
|
fn respond_to(self, req: &Request) -> Result<Response<'r>, Status> {
|
||||||
|
self.respond_to(req)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Returns a response with a sized body for the file. Always returns `Ok`.
|
/// Returns a response with a sized body for the file. Always returns `Ok`.
|
||||||
impl<'r> Responder<'r> for File {
|
impl<'r> Responder<'r> for File {
|
||||||
fn respond_to(self, _: &Request) -> Result<Response<'r>, Status> {
|
fn respond_to(self, _: &Request) -> Result<Response<'r>, Status> {
|
||||||
|
|
Loading…
Reference in New Issue