pub struct Context { /* private fields */ }
Expand description
Implementations§
Source§impl Context
impl Context
Sourcepub fn defer(&mut self, task: Box<dyn Runnable + UnwindSafe>)
pub fn defer(&mut self, task: Box<dyn Runnable + UnwindSafe>)
Adds a task to the deferred task queue. The task queue uses event.waitUntil to extend the lifetime of the request event, and runs tasks after the response has been returned to the client. Deferred tasks are often useful for logging and analytics.
Sourcepub fn take_logs(&mut self) -> Vec<LogEntry>
pub fn take_logs(&mut self) -> Vec<LogEntry>
Returns pending log messages, emptying internal queue. This is used for sending queued messages to an external log service
Sourcepub fn raise_internal_error(&mut self, e: Box<dyn Error>)
pub fn raise_internal_error(&mut self, e: Box<dyn Error>)
Sets the internal error flag, which causes wasm_service to invoke the internal_error_handler
Sourcepub fn is_internal_error(&self) -> Option<&dyn Error>
pub fn is_internal_error(&self) -> Option<&dyn Error>
Returns whether the internal error flag has been set
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Context
impl !RefUnwindSafe 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