qubit_executor/task/cancel_result.rs
1/*******************************************************************************
2 *
3 * Copyright (c) 2025 - 2026 Haixing Hu.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * Licensed under the Apache License, Version 2.0.
8 *
9 ******************************************************************************/
10/// Result of an attempt to cancel a tracked task.
11#[derive(Debug, Clone, Copy, PartialEq, Eq)]
12pub enum CancelResult {
13 /// The task was cancelled before it started.
14 Cancelled,
15 /// The task had already started and cannot be cancelled cooperatively.
16 AlreadyRunning,
17 /// The task had already reached a terminal state.
18 AlreadyFinished,
19 /// The backing service or handle does not support active cancellation.
20 Unsupported,
21}