mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
39 lines
1.1 KiB
Rust
39 lines
1.1 KiB
Rust
pub use taskchampion::Status;
|
|
|
|
/// The status of a task, as defined by the task data model.
|
|
/// cbindgen:prefix-with-name
|
|
/// cbindgen:rename-all=ScreamingSnakeCase
|
|
#[repr(C)]
|
|
pub enum TCStatus {
|
|
Pending,
|
|
Completed,
|
|
Deleted,
|
|
Recurring,
|
|
/// Unknown signifies a status in the task DB that was not
|
|
/// recognized.
|
|
Unknown,
|
|
}
|
|
|
|
impl From<TCStatus> for Status {
|
|
fn from(status: TCStatus) -> Status {
|
|
match status {
|
|
TCStatus::Pending => Status::Pending,
|
|
TCStatus::Completed => Status::Completed,
|
|
TCStatus::Deleted => Status::Deleted,
|
|
TCStatus::Recurring => Status::Recurring,
|
|
_ => Status::Unknown(format!("unknown TCStatus {}", status as u32)),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl From<Status> for TCStatus {
|
|
fn from(status: Status) -> TCStatus {
|
|
match status {
|
|
Status::Pending => TCStatus::Pending,
|
|
Status::Completed => TCStatus::Completed,
|
|
Status::Deleted => TCStatus::Deleted,
|
|
Status::Recurring => TCStatus::Recurring,
|
|
Status::Unknown(_) => TCStatus::Unknown,
|
|
}
|
|
}
|
|
}
|