Struct lando::LambdaContext
[−]
[src]
pub struct LambdaContext<'a> { /* fields omitted */ }
Provides a view into the context
object available to Lambda functions.
Context object methods and attributes are documented at [The Context Object (Python)] (https://docs.aws.amazon.com/lambda/latest/dg/python-context-object.html) in the AWS Lambda docs.
Methods
impl<'a> LambdaContext<'a>
[src]
pub fn function_name(&self) -> &str
[src]
Name of the Lambda function that is executing.
pub fn function_version(&self) -> &str
[src]
The Lambda function version that is executing. If an alias is used to invoke the function,
then function_version
will be the version the alias points to.
pub fn invoked_function_arn(&self) -> &str
[src]
The ARN used to invoke this function. It can be function ARN or alias ARN. An unqualified
ARN executes the $LATEST
version and aliases execute the function version it is pointing
to.
pub fn memory_limit_in_mb(&self) -> &str
[src]
Memory limit, in MB, you configured for the Lambda function. You set the memory limit at the time you create a Lambda function and you can change it later.
pub fn aws_request_id(&self) -> &str
[src]
AWS request ID associated with the request. This is the ID returned to the client that called the invoke method.
Note: If AWS Lambda retries the invocation (for example, in a situation where the Lambda function that is processing Amazon Kinesis records throws an exception), the request ID remains the same.
pub fn log_group_name(&self) -> &str
[src]
The name of the CloudWatch log group where you can find logs written by your Lambda function.
pub fn log_stream_name(&self) -> &str
[src]
The name of the CloudWatch log stream where you can find logs written by your Lambda function. The log stream may or may not change for each invocation of the Lambda function.
pub fn get_remaining_time_in_millis(&self) -> Result<u64, ContextError>
[src]
Returns the remaining execution time, in milliseconds, until AWS Lambda terminates the function.
This returns ContextError::GetRemainingTimeFailed
if crowbar is unable to call the method
or cast it to a u64
from the Python object. This should generally never happen, so you
should simply call this as context.get_remaining_time_in_millis()?
in your function.