pub struct LambdaResponse {
pub status: u16,
pub headers: HashMap<String, String>,
pub body: Bytes,
pub is_base64: bool,
}Expand description
Lambda HTTP response.
Fields§
§status: u16Status code.
headers: HashMap<String, String>Response headers.
body: BytesResponse body.
is_base64: boolWhether body is base64 encoded.
Implementations§
Source§impl LambdaResponse
impl LambdaResponse
Sourcepub fn internal_error(message: impl Into<String>) -> Self
pub fn internal_error(message: impl Into<String>) -> Self
Create an internal server error response.
Sourcepub fn content_type(self, content_type: impl Into<String>) -> Self
pub fn content_type(self, content_type: impl Into<String>) -> Self
Set content type.
Sourcepub fn into_lambda_response(self) -> Response<Body>
pub fn into_lambda_response(self) -> Response<Body>
Convert to lambda_http::Response.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for LambdaResponse
impl RefUnwindSafe for LambdaResponse
impl Send for LambdaResponse
impl Sync for LambdaResponse
impl Unpin for LambdaResponse
impl UnwindSafe for LambdaResponse
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