[][src]Struct lambda_runtime::Context

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.

Fields

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.

Methods

impl Context
[src]

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.

Trait Implementations

impl Clone for Context
[src]

Performs copy-assignment from source. Read more

impl Default for Context
[src]

Auto Trait Implementations

impl Send for Context

impl Sync for Context

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Erased for T