[−][src]Struct lambda_runtime::Context
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
memory_limit_in_mb: i32
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.
function_name: String
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.
function_version: String
The version of the function being invoked. This value is extracted
from the AWS_LAMBDA_FUNCTION_VERSION
environment variable set
by the Lambda service.
invoked_function_arn: String
The fully qualified ARN (Amazon Resource Name) for the function invocation event. This value is returned by the Lambda Runtime APIs as a header.
aws_request_id: String
The AWS request ID for the current invocation event. This value is returned by the Lambda Runtime APIs as a header.
xray_trace_id: Option<String>
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.
log_stream_name: String
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.
log_group_name: String
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.
client_context: Option<ClientContext>
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.
identity: Option<CognitoIdentity>
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.
deadline: i64
The deadline for the current handler execution in milliseconds, based
on a unix MONOTONIC
clock.
Methods
impl Context
[src]
pub fn get_time_remaining_millis(&self) -> i64
[src]
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]
fn clone(&self) -> Context
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for Context
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,