egui_pop_api/bus/
job_rows.rs1use bus_contract::{Point, PointId, PointKind};
13use egui_pop_model::job_rows::JobRow;
14use serde::{Deserialize, Serialize};
15
16#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
19#[non_exhaustive]
20pub struct JobRowsAsk {
21 pub source: String,
22 pub title: String,
23 pub owner: String,
25 pub rows: Vec<JobRow>,
26}
27
28impl JobRowsAsk {
29 pub fn new(
30 source: impl Into<String>,
31 title: impl Into<String>,
32 owner: impl Into<String>,
33 rows: Vec<JobRow>,
34 ) -> Self {
35 Self {
36 source: source.into(),
37 title: title.into(),
38 owner: owner.into(),
39 rows,
40 }
41 }
42}
43
44#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
46#[non_exhaustive]
47pub struct JobSourceAsk {
48 pub source: String,
49 pub owner: String,
50}
51
52impl JobSourceAsk {
53 pub fn new(source: impl Into<String>, owner: impl Into<String>) -> Self {
54 Self {
55 source: source.into(),
56 owner: owner.into(),
57 }
58 }
59}
60
61#[derive(Debug)]
64pub struct JobRowsSet;
65impl Point for JobRowsSet {
66 const KIND: PointKind = PointKind::Request;
67 const ID: PointId = PointId::new("pop.jobs.rows");
68 type Input = JobRowsAsk;
69 type Value = Vec<String>;
70}
71
72#[derive(Debug)]
74pub struct JobSourceDrop;
75impl Point for JobSourceDrop {
76 const KIND: PointKind = PointKind::Request;
77 const ID: PointId = PointId::new("pop.jobs.source.drop");
78 type Input = JobSourceAsk;
79 type Value = Vec<String>;
80}
81
82pub const JOB_ROW_POINTS: [&str; 2] = [JobRowsSet::ID.as_str(), JobSourceDrop::ID.as_str()];
84
85pub const SOURCES: &str = "pop.jobs.sources";