chia_node/harvester/
model.rs

1use chrono::DateTime;
2use chrono::Utc;
3use serde::Deserialize;
4use serde_json::Value;
5use serde_with::chrono::datetime_utc_ts_seconds_from_any;
6
7#[derive(Debug, Deserialize)]
8pub(crate) struct GetPlotsResponse {
9	pub failed_to_open_filenames: Vec<String>,
10	pub not_found_filenames: Vec<String>,
11	pub plots: Vec<Plot>,
12	pub success: bool
13}
14
15#[derive(Debug, Deserialize)]
16pub struct Plots {
17	pub failed_to_open_filenames: Vec<String>,
18	pub not_found_filenames: Vec<String>,
19	pub plots: Vec<Plot>
20}
21
22impl From<GetPlotsResponse> for Plots {
23	fn from(other: GetPlotsResponse) -> Self {
24		Self{
25			failed_to_open_filenames: other.failed_to_open_filenames,
26			not_found_filenames: other.not_found_filenames,
27			plots: other.plots
28		}
29	}
30}
31
32#[derive(Debug, Deserialize)]
33pub struct Plot {
34	pub file_size: u64,
35	pub filename: String,
36	#[serde(rename = "plot-seed")]
37	pub plot_seed: String,
38	pub plot_public_key: String,
39	pub pool_contract_puzzle_hash: Value,
40	pub pool_public_key: String,
41	pub size: u8,
42	#[serde(with = "datetime_utc_ts_seconds_from_any")]
43	pub time_modified: DateTime<Utc>
44}
45