Trait rustful::filter::ResponseFilter
[−]
[src]
pub trait ResponseFilter: Send + Sync { fn begin(
&self,
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
fn begin(
&self,
context: FilterContext,
status: StatusCode,
headers: &mut Headers
) -> (StatusCode, ResponseAction)
&self,
context: FilterContext,
status: StatusCode,
headers: &mut Headers
) -> (StatusCode, ResponseAction)
Set or modify headers before they are sent to the client and maybe initiate the body.
fn write<'a>(
&'a self,
context: FilterContext,
content: Option<Data<'a>>
) -> ResponseAction
&'a self,
context: FilterContext,
content: Option<Data<'a>>
) -> ResponseAction
Handle content before writing it to the body.
fn end(&self, context: FilterContext) -> ResponseAction
End of body writing. Last chance to add content.