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 maybe_with_link<N, L>(self, name: N, link: Option<L>) -> Self
pub fn maybe_with_link<N, L>(self, name: N, link: Option<L>) -> Self
Add a new link to a HAL document.
Sourcepub fn with_embedded<N, H>(self, name: N, value: H) -> Self
pub fn with_embedded<N, H>(self, name: N, value: H) -> Self
Add a new embedded HAL document to the HAL document.
Sourcepub fn maybe_with_embedded<N, H>(self, name: N, value: Option<H>) -> Self
pub fn maybe_with_embedded<N, H>(self, name: N, value: Option<H>) -> Self
Add a new embedded HAL document to the HAL document.
Sourcepub fn with_template<N, T>(self, name: N, value: T) -> Self
pub fn with_template<N, T>(self, name: N, value: T) -> Self
Add a new action template to the HAL-FORMS document.
Sourcepub fn maybe_with_template<N, T>(self, name: N, template: Option<T>) -> Self
pub fn maybe_with_template<N, T>(self, name: N, template: Option<T>) -> Self
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.
Sourcepub fn with_header<H>(self, header: H) -> Selfwhere
H: Header,
pub fn with_header<H>(self, header: H) -> Selfwhere
H: Header,
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HalResponse
impl RefUnwindSafe for HalResponse
impl Send for HalResponse
impl Sync for HalResponse
impl Unpin for HalResponse
impl UnwindSafe for HalResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more