Trait rustful::filter::ResponseFilter [] [src]

pub trait ResponseFilter: Send + Sync {
    fn begin(
        context: FilterContext,
        status: StatusCode,
        headers: &mut Headers
    ) -> (StatusCode, ResponseAction);
fn write<'a>(
        &'a self,
        context: FilterContext,
        content: Option<Data<'a>>
    ) -> ResponseAction;
fn end(&self, context: FilterContext) -> ResponseAction; }

A trait for response filters.

They are able to modify headers and data before it gets written in the response.

Required Methods

Set or modify headers before they are sent to the client and maybe initiate the body.

Handle content before writing it to the body.

End of body writing. Last chance to add content.