pub struct Invocation {
pub request_id: String,
pub payload: Value,
pub created_at: DateTime<Utc>,
pub deadline: DateTime<Utc>,
pub aws_request_id: String,
pub invoked_function_arn: String,
pub trace_id: String,
pub client_context: Option<String>,
pub cognito_identity: Option<String>,
}Expand description
Represents a Lambda invocation request.
Fields§
§request_id: StringUnique identifier for this invocation.
payload: ValueThe invocation payload (function input).
created_at: DateTime<Utc>Timestamp when the invocation was created.
deadline: DateTime<Utc>Deadline by which the invocation must complete.
aws_request_id: StringAWS request ID (for X-Ray tracing).
invoked_function_arn: StringARN of the function being invoked.
trace_id: StringAWS X-Ray trace ID.
client_context: Option<String>Client context (for mobile SDK).
cognito_identity: Option<String>Cognito identity (for mobile SDK).
Implementations§
Source§impl Invocation
impl Invocation
Sourcepub fn new(payload: Value, timeout_ms: u64) -> Self
pub fn new(payload: Value, timeout_ms: u64) -> Self
Creates a new invocation with default values.
§Arguments
payload- The JSON payload for this invocationtimeout_ms- Timeout in milliseconds for this invocation
§Returns
A new Invocation instance with generated IDs and timestamps.
§Examples
use serde_json::json;
use lambda_simulator::invocation::Invocation;
let invocation = Invocation::new(json!({"key": "value"}), 3000);
assert!(!invocation.request_id.is_empty());Sourcepub fn deadline_ms(&self) -> i64
pub fn deadline_ms(&self) -> i64
Returns the deadline as milliseconds since Unix epoch.
This is used for the Lambda-Runtime-Deadline-Ms header.
Trait Implementations§
Source§impl Clone for Invocation
impl Clone for Invocation
Source§fn clone(&self) -> Invocation
fn clone(&self) -> Invocation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Invocation
impl Debug for Invocation
Source§impl<'de> Deserialize<'de> for Invocation
impl<'de> Deserialize<'de> for Invocation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Invocation
impl RefUnwindSafe for Invocation
impl Send for Invocation
impl Sync for Invocation
impl Unpin for Invocation
impl UnwindSafe for Invocation
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