Trait rustful::response::SendResponse
[−]
[src]
pub trait SendResponse<'a, 'b> { type Error: ResponseError; fn send_response(
self,
response: Response<'a, 'b>
) -> Result<(), Self::Error>; }
A trait for higher level types that can be sent as responses, like
Result
.
Such a type is allowed to modify the response headers and status before sending, to lower the amount of boiler plate code, and makes it a bit easier to use together with the usual error handling methods. The default implementations will only change the status code when semantically appropriate, and otherwise not touch it at all.
Associated Types
type Error: ResponseError
Any error that may occur while sending the response.
Required Methods
fn send_response(self, response: Response<'a, 'b>) -> Result<(), Self::Error>
Send a response to the client.
Implementations on Foreign Types
impl<'a, 'b, T: SendResponse<'a, 'b>, U: SendResponse<'a, 'b>> SendResponse<'a, 'b> for Result<T, U> where
U::Error: Into<T::Error>,
[src]
impl<'a, 'b, T: SendResponse<'a, 'b>, U: SendResponse<'a, 'b>> SendResponse<'a, 'b> for Result<T, U> where
U::Error: Into<T::Error>,
impl<'a, 'b, T: SendResponse<'a, 'b>> SendResponse<'a, 'b> for Option<T>
[src]
impl<'a, 'b, T: SendResponse<'a, 'b>> SendResponse<'a, 'b> for Option<T>
impl<'a, 'b> SendResponse<'a, 'b> for Error
[src]
impl<'a, 'b> SendResponse<'a, 'b> for Error
impl<'d, 'a, 'b> SendResponse<'a, 'b> for &'d Path
[src]
impl<'d, 'a, 'b> SendResponse<'a, 'b> for &'d Path
impl<'a, 'b> SendResponse<'a, 'b> for PathBuf
[src]
impl<'a, 'b> SendResponse<'a, 'b> for PathBuf
impl<'a, 'b> SendResponse<'a, 'b> for File
[src]
impl<'a, 'b> SendResponse<'a, 'b> for File