100-exercises-to-learn-rust/exercises/07_threads/10_patch/src/data.rs

32 lines
695 B
Rust

use crate::store::TicketId;
use ticket_fields::{TicketDescription, TicketTitle};
#[derive(Clone, Debug, PartialEq)]
pub struct Ticket {
pub id: TicketId,
pub title: TicketTitle,
pub description: TicketDescription,
pub status: Status,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct TicketDraft {
pub title: TicketTitle,
pub description: TicketDescription,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct TicketPatch {
pub id: TicketId,
pub title: Option<TicketTitle>,
pub description: Option<TicketDescription>,
pub status: Option<Status>,
}
#[derive(Clone, Debug, Copy, PartialEq, Eq)]
pub enum Status {
ToDo,
InProgress,
Done,
}