Struct webmachine_rust::context::WebmachineResponse
[−]
[src]
pub struct WebmachineResponse { pub status: u16, pub headers: BTreeMap<String, Vec<HeaderValue>>, pub body: Option<String>, }
Response that is generated as a result of the webmachine execution
Fields
status: u16
status code to return
headers: BTreeMap<String, Vec<HeaderValue>>
headers to return
body: Option<String>
Response Body
Methods
impl WebmachineResponse
[src]
fn default() -> WebmachineResponse
Creates a default response (200 OK)
fn has_header(&self, header: &String) -> bool
If the response has the provided header
fn add_header(&mut self, header: String, values: Vec<HeaderValue>)
Adds the header values to the headers
fn add_headers(&mut self, headers: HashMap<String, Vec<String>>)
Adds the headers from a HashMap to the headers
fn add_cors_headers(&mut self, allowed_methods: &Vec<String>)
Adds standard CORS headers to the response
fn cors_headers(allowed_methods: &Vec<String>) -> HashMap<String, Vec<String>>
Returns a HaspMap of standard CORS headers
fn has_body(&self) -> bool
If the response has a body
Trait Implementations
impl Debug for WebmachineResponse
[src]
impl Clone for WebmachineResponse
[src]
fn clone(&self) -> WebmachineResponse
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for WebmachineResponse
[src]
fn eq(&self, __arg_0: &WebmachineResponse) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &WebmachineResponse) -> bool
This method tests for !=
.