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: Context
Methods from Deref<Target = Context>§
sourcepub 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§async fn from_request(req: &'a Request, _body: &mut RequestBody) -> Result<Self>
async fn from_request(req: &'a Request, _body: &mut RequestBody) -> Result<Self>
Extract from request head and body.
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)