Skip to main content

provenant/output_schema/
tally_entry.rs

1// SPDX-FileCopyrightText: Provenant contributors
2// SPDX-License-Identifier: Apache-2.0
3
4use serde::{Deserialize, Serialize};
5
6#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
7pub struct OutputTallyEntry {
8    pub value: Option<String>,
9    pub count: usize,
10}
11
12impl From<&crate::models::TallyEntry> for OutputTallyEntry {
13    fn from(value: &crate::models::TallyEntry) -> Self {
14        Self {
15            value: value.value.clone(),
16            count: value.count,
17        }
18    }
19}
20
21impl From<&OutputTallyEntry> for crate::models::TallyEntry {
22    fn from(value: &OutputTallyEntry) -> Self {
23        Self {
24            value: value.value.clone(),
25            count: value.count,
26        }
27    }
28}