pub struct AwsResponse {
pub status: StatusCode,
pub content_type: String,
pub body: ResponseBody,
pub headers: HeaderMap,
}Expand description
A response from a service handler.
Fields§
§status: StatusCode§content_type: String§body: ResponseBody§headers: HeaderMapImplementations§
Source§impl AwsResponse
impl AwsResponse
pub fn xml(status: StatusCode, body: impl Into<Bytes>) -> Self
pub fn json(status: StatusCode, body: impl Into<Bytes>) -> Self
Sourcepub fn json_value(status: StatusCode, value: Value) -> Self
pub fn json_value(status: StatusCode, value: Value) -> Self
Build a JSON response from a serde_json::Value with an explicit status.
Serialization of an in-memory Value cannot fail — it has no cycles and
no custom serializers — so the inner to_vec is documented as infallible
rather than left as a bare unwrap().
Auto Trait Implementations§
impl !Freeze for AwsResponse
impl !RefUnwindSafe for AwsResponse
impl Send for AwsResponse
impl Sync for AwsResponse
impl Unpin for AwsResponse
impl UnsafeUnpin for AwsResponse
impl UnwindSafe for AwsResponse
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