pub struct BackgroundTask { /* private fields */ }Expand description
One runtime-neutral task that begins after the response body is written.
Implementations§
Source§impl BackgroundTask
impl BackgroundTask
pub fn new<Task, TaskFuture>(task: Task) -> Selfwhere
Task: FnOnce() -> TaskFuture + 'static,
TaskFuture: Future<Output = Result<(), BackgroundTaskError>> + 'static,
pub fn infallible<Task, TaskFuture>(task: Task) -> Self
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for BackgroundTask
impl !Send for BackgroundTask
impl !Sync for BackgroundTask
impl !UnwindSafe for BackgroundTask
impl Freeze for BackgroundTask
impl Unpin for BackgroundTask
impl UnsafeUnpin for BackgroundTask
Blanket Implementations§
Source§impl<T> BackgroundExt for T
impl<T> BackgroundExt for T
fn background(self, task: BackgroundTask) -> Background<Self>
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