Struct http_halforms::HalResponse
source · pub struct HalResponse {
pub hal: Hal,
pub status_code: StatusCode,
pub headers: HeaderMap,
}Expand description
Representation of a HAL or HAL-FORMS response that can be returned to a client.
Fields§
§hal: Hal§status_code: StatusCode§headers: HeaderMapImplementations§
source§impl HalResponse
impl HalResponse
sourcepub fn with_link<N, L>(self, name: N, link: L) -> Selfwhere
N: ToString,
L: Into<Link>,
pub fn with_link<N, L>(self, name: N, link: L) -> Selfwhere
N: ToString,
L: Into<Link>,
Add a new link to a HAL document.
sourcepub fn maybe_with_link<N, L>(self, name: N, link: Option<L>) -> Selfwhere
N: ToString,
L: Into<Link>,
pub fn maybe_with_link<N, L>(self, name: N, link: Option<L>) -> Selfwhere
N: ToString,
L: Into<Link>,
Add a new link to a HAL document.
sourcepub fn with_embedded<N, H>(self, name: N, value: H) -> Selfwhere
N: ToString,
H: Into<Hal>,
pub fn with_embedded<N, H>(self, name: N, value: H) -> Selfwhere
N: ToString,
H: Into<Hal>,
Add a new embedded HAL document to the HAL document.
sourcepub fn maybe_with_embedded<N, H>(self, name: N, value: Option<H>) -> Selfwhere
N: ToString,
H: Into<Hal>,
pub fn maybe_with_embedded<N, H>(self, name: N, value: Option<H>) -> Selfwhere
N: ToString,
H: Into<Hal>,
Add a new embedded HAL document to the HAL document.
sourcepub fn with_template<N, T>(self, name: N, value: T) -> Selfwhere
N: ToString,
T: Into<Template>,
pub fn with_template<N, T>(self, name: N, value: T) -> Selfwhere
N: ToString,
T: Into<Template>,
Add a new action template to the HAL-FORMS document.
sourcepub fn maybe_with_template<N, T>(self, name: N, template: Option<T>) -> Selfwhere
N: ToString,
T: Into<Template>,
pub fn maybe_with_template<N, T>(self, name: N, template: Option<T>) -> Selfwhere
N: ToString,
T: Into<Template>,
Add a new action template to the HAL-FORMS document.
sourcepub fn with_status_code<S>(self, status_code: S) -> Selfwhere
S: Into<StatusCode>,
pub fn with_status_code<S>(self, status_code: S) -> Selfwhere
S: Into<StatusCode>,
Specify the status code of the HTTP response.