Struct poem_lambda::Context
source · pub struct Context(pub Context);Expand description
The Lambda function execution context.
It implements poem::FromRequest, so it can be used as an extractor.
Example
use poem::{handler, Request};
use poem_lambda::Context;
#[handler]
fn index(req: &Request, ctx: &Context) {
println!("request_id: {}", ctx.request_id);
}Tuple Fields§
§0: ContextMethods from Deref<Target = Context>§
pub fn deadline(&self) -> SystemTime
pub fn deadline(&self) -> SystemTime
The execution deadline for the current invocation.
Trait Implementations§
source§impl<'a> FromRequest<'a> for &'a Context
impl<'a> FromRequest<'a> for &'a Context
source§fn from_request<'life0, 'async_trait>(
req: &'a Request,
_body: &'life0 mut RequestBody
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
fn from_request<'life0, 'async_trait>( req: &'a Request, _body: &'life0 mut RequestBody ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,
Extract from request head and body.