Skip to main content

AsyncTask

Trait AsyncTask 

Source
pub trait AsyncTask:
    Send
    + Sync
    + 'static {
    // Required methods
    fn task_type(&self) -> &str;
    fn execute(&self) -> Pin<Box<dyn Future<Output = AsyncTaskResult> + Send>>;

    // Provided method
    fn timeout(&self) -> Duration { ... }
}
Expand description

非同期Task の抽象 - ユーザーが自由に実装可能

Required Methods§

Source

fn task_type(&self) -> &str

Task の種類(ログ・デバッグ用)

Source

fn execute(&self) -> Pin<Box<dyn Future<Output = AsyncTaskResult> + Send>>

非同期実行

Provided Methods§

Source

fn timeout(&self) -> Duration

タイムアウト(デフォルト: 30秒)

Implementors§