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: ContextTrait Implementations
fn from_request<'life0, 'async_trait>(
req: &'a Request,
_body: &'life0 mut RequestBody
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>> where
'a: 'async_trait,
'life0: 'async_trait,
Self: '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
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Extract from request head and body.
Auto Trait Implementations
impl RefUnwindSafe for Context
impl UnwindSafe for Context
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more
