Struct tokio_tasks::Task
source · pub struct Task<T: Send + Sync, E: Sync> { /* private fields */ }
Expand description
A possible running task, with a return value of Result<T, E>
Implementations§
Trait Implementations§
source§impl<T: Send + Sync + 'static, E: Send + Sync + 'static> TaskBase for Task<T, E>
impl<T: Send + Sync + 'static, E: Send + Sync + 'static> TaskBase for Task<T, E>
source§fn shutdown_order(&self) -> i32
fn shutdown_order(&self) -> i32
Return the shutdown order of this task as defined by the TaskBuilder
source§fn name(&self) -> &str
fn name(&self) -> &str
Return the name of this task as defined by the TaskBuilder
source§fn cancel(self: Arc<Self>) -> BoxFuture<'static, ()>
fn cancel(self: Arc<Self>) -> BoxFuture<'static, ()>
Cantle the task, return futer that returns when the task is done
source§fn main(&self) -> bool
fn main(&self) -> bool
If true the application will shut down with an error if this task returns
source§fn abort(&self) -> bool
fn abort(&self) -> bool
If this is true the task will be cancled by dropping the future instead of signaling the run token
source§fn critical(&self) -> bool
fn critical(&self) -> bool
If true the application will shut down with an error if this task returns with an error
source§fn start_time(&self) -> f64
fn start_time(&self) -> f64
Unixtimestamp of when the task started
source§fn no_shutdown(&self) -> bool
fn no_shutdown(&self) -> bool
Do not stop task on shutdown
Auto Trait Implementations§
impl<T, E> !RefUnwindSafe for Task<T, E>
impl<T, E> Send for Task<T, E>where
E: Send,
impl<T, E> Sync for Task<T, E>where
E: Send,
impl<T, E> Unpin for Task<T, E>
impl<T, E> !UnwindSafe for Task<T, E>
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