[−][src]Struct webmachine_rust::context::WebmachineResponse
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<Vec<u8>>
Response Body
Implementations
impl WebmachineResponse
[src]
pub fn default() -> WebmachineResponse
[src]
Creates a default response (200 OK)
pub fn has_header(&self, header: &str) -> bool
[src]
If the response has the provided header
pub fn add_header(&mut self, header: &str, values: Vec<HeaderValue>)
[src]
Adds the header values to the headers
pub fn add_headers(&mut self, headers: HashMap<String, Vec<String>>)
[src]
Adds the headers from a HashMap to the headers
pub fn add_cors_headers(&mut self, allowed_methods: &Vec<&str>)
[src]
Adds standard CORS headers to the response
pub fn cors_headers(allowed_methods: &Vec<&str>) -> HashMap<String, Vec<String>>
[src]
Returns a HashMap of standard CORS headers
pub fn has_body(&self) -> bool
[src]
If the response has a body
Trait Implementations
impl Clone for WebmachineResponse
[src]
pub fn clone(&self) -> WebmachineResponse
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for WebmachineResponse
[src]
impl PartialEq<WebmachineResponse> for WebmachineResponse
[src]
pub fn eq(&self, other: &WebmachineResponse) -> bool
[src]
pub fn ne(&self, other: &WebmachineResponse) -> bool
[src]
impl StructuralPartialEq for WebmachineResponse
[src]
Auto Trait Implementations
impl RefUnwindSafe for WebmachineResponse
[src]
impl Send for WebmachineResponse
[src]
impl Sync for WebmachineResponse
[src]
impl Unpin for WebmachineResponse
[src]
impl UnwindSafe for WebmachineResponse
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,