pub struct LambdaInvocationOutput {
pub payload: Vec<u8>,
pub function_error: Option<String>,
}Expand description
What a synchronous Lambda invocation produced: the response payload and,
when the function failed, the X-Amz-Function-Error value. This is the
signal real Lambda gives (Invoke still returns 200); integrations must
branch on function_error, never on the payload’s shape, because a
function may legitimately return an object carrying errorType /
errorMessage, and some failures (a timeout reported without an
errorType by older runtimes) carry only one of them.
Fields§
§payload: Vec<u8>The response payload. For a function error this is the error object
({"errorType", "errorMessage", ...}) the runtime reported.
function_error: Option<String>Some("Unhandled") when the invocation produced a function error.
Implementations§
Source§impl LambdaInvocationOutput
impl LambdaInvocationOutput
Sourcepub fn success(payload: impl Into<Vec<u8>>) -> Self
pub fn success(payload: impl Into<Vec<u8>>) -> Self
A successful invocation that returned payload.
Sourcepub fn unhandled(payload: impl Into<Vec<u8>>) -> Self
pub fn unhandled(payload: impl Into<Vec<u8>>) -> Self
An invocation that failed with a function error reported as payload.
Sourcepub fn is_function_error(&self) -> bool
pub fn is_function_error(&self) -> bool
True when the function failed (X-Amz-Function-Error was set).
Sourcepub fn error_type(&self) -> Option<String>
pub fn error_type(&self) -> Option<String>
The error object’s errorType, for a function error whose payload
names one. None for a success or an error payload without a type.
Sourcepub fn error_message(&self) -> Option<String>
pub fn error_message(&self) -> Option<String>
The error object’s errorMessage, for a function error whose payload
carries one.
Trait Implementations§
Source§impl Clone for LambdaInvocationOutput
impl Clone for LambdaInvocationOutput
Source§impl Debug for LambdaInvocationOutput
impl Debug for LambdaInvocationOutput
impl Eq for LambdaInvocationOutput
Source§impl PartialEq for LambdaInvocationOutput
impl PartialEq for LambdaInvocationOutput
impl StructuralPartialEq for LambdaInvocationOutput
Auto Trait Implementations§
impl Forget for LambdaInvocationOutput
impl Freeze for LambdaInvocationOutput
impl Move for LambdaInvocationOutput
impl RefUnwindSafe for LambdaInvocationOutput
impl Send for LambdaInvocationOutput
impl Sync for LambdaInvocationOutput
impl Unpin for LambdaInvocationOutput
impl UnsafeUnpin for LambdaInvocationOutput
impl UnwindSafe for LambdaInvocationOutput
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.