pub struct Context {
pub memory_limit_in_mb: i32,
pub function_name: String,
pub function_version: String,
pub invoked_function_arn: String,
pub aws_request_id: String,
pub xray_trace_id: String,
pub log_stream_name: String,
pub log_group_name: String,
pub client_context: Option<ClientContext>,
pub identity: Option<CognitoIdentity>,
// some fields omitted
}
The Lambda function execution context. The values in this struct
are populated using the Lambda environment variables
and the headers returned by the poll request to the Runtime APIs.
A new instance of the Context
object is passed to each handler invocation.
The amount of memory allocated to the Lambda function in Mb.
This value is extracted from the AWS_LAMBDA_FUNCTION_MEMORY_SIZE
environment variable set by the Lambda service.
The name of the Lambda function as registered with the Lambda
service. The value is extracted from the AWS_LAMBDA_FUNCTION_NAME
environment variable set by the Lambda service.
The version of the function being invoked. This value is extracted
from the AWS_LAMBDA_FUNCTION_VERSION
environment variable set
by the Lambda service.
The fully qualified ARN (Amazon Resource Name) for the function
invocation event. This value is returned by the Lambda Runtime APIs
as a header.
The AWS request ID for the current invocation event. This value
is returned by the Lambda Runtime APIs as a header.
The X-Ray trace ID for the current invocation. This value is returned
by the Lambda Runtime APIs as a header. Developers can use this value
with the AWS SDK to create new, custom sub-segments to the current
invocation.
The name of the CloudWatch log stream for the current execution
environment. This value is extracted from the AWS_LAMBDA_LOG_STREAM_NAME
environment variable set by the Lambda service.
The name of the CloudWatch log group for the current execution
environment. This value is extracted from the AWS_LAMBDA_LOG_GROUP_NAME
environment variable set by the Lambda service.
The client context sent by the AWS Mobile SDK with the invocation
request. This value is returned by the Lambda Runtime APIs as a
header. This value is populated only if the invocation request
originated from an AWS Mobile SDK or an SDK that attached the client
context information to the request.
The information of the Cognito identity that sent the invocation
request to the Lambda service. This value is returned by the Lambda
Runtime APIs in a header and it's only populated if the invocation
request was performed with AWS credentials federated through the Cognito
identity service.
We use the context for each event to store the stack trace. This is the methods
clients should use to retrieve an initialized RuntimeError
with the populated
stack trace.
Returns the remaining time in the execution in milliseconds. This is based on the
deadline header passed by Lambda's Runtime APIs.
Performs copy-assignment from source
. Read more
Returns the "default value" for a type. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Mutably borrows from an owned value. Read more