Trait tokio_tasks::TaskBase
source · pub trait TaskBase: Send + Sync {
// Required methods
fn shutdown_order(&self) -> i32;
fn name(&self) -> &str;
fn id(&self) -> usize;
fn main(&self) -> bool;
fn abort(&self) -> bool;
fn critical(&self) -> bool;
fn start_time(&self) -> f64;
fn cancel(self: Arc<Self>) -> BoxFuture<'static, ()>;
fn run_token(&self) -> &RunToken;
fn no_shutdown(&self) -> bool;
}
Expand description
Base trait for all tasks, that is independent of the return type
Required Methods§
sourcefn shutdown_order(&self) -> i32
fn shutdown_order(&self) -> i32
Return the shutdown order of this task as defined by the TaskBuilder
sourcefn name(&self) -> &str
fn name(&self) -> &str
Return the name of this task as defined by the TaskBuilder
sourcefn main(&self) -> bool
fn main(&self) -> bool
If true the application will shut down with an error if this task returns
sourcefn 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
sourcefn critical(&self) -> bool
fn critical(&self) -> bool
If true the application will shut down with an error if this task returns with an error
sourcefn start_time(&self) -> f64
fn start_time(&self) -> f64
Unixtimestamp of when the task started
sourcefn 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
sourcefn no_shutdown(&self) -> bool
fn no_shutdown(&self) -> bool
Do not stop task on shutdown