Skip to main content

rocie_client/
implies.rs

1// rocie - An enterprise grocery management system
2//
3// Copyright (C) 2026 Benedikt Peetz <benedikt.peetz@b-peetz.de>
4// SPDX-License-Identifier: GPL-3.0-or-later
5//
6// This file is part of Rocie.
7//
8// You should have received a copy of the License along with this program.
9// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
10
11use std::fmt::Display;
12
13use crate::models::{
14    BarcodeId, ProductId, ProductParentId, RecipeId, RecipeParentId, UnitId, UnitPropertyId, UserId,
15};
16
17// TODO(@bpeetz): The client generator should just do this. <2025-09-23>
18
19impl Display for BarcodeId {
20    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21        self.value.fmt(f)
22    }
23}
24impl Copy for BarcodeId {}
25
26impl Display for ProductId {
27    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
28        self.value.fmt(f)
29    }
30}
31impl Copy for ProductId {}
32
33impl Display for UnitId {
34    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
35        self.value.fmt(f)
36    }
37}
38impl Copy for UnitId {}
39
40impl Display for UnitPropertyId {
41    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
42        self.value.fmt(f)
43    }
44}
45impl Copy for UnitPropertyId {}
46
47impl Display for ProductParentId {
48    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
49        self.value.fmt(f)
50    }
51}
52impl Copy for ProductParentId {}
53
54impl Display for RecipeId {
55    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
56        self.value.fmt(f)
57    }
58}
59impl Copy for RecipeId {}
60
61impl Display for UserId {
62    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
63        self.value.fmt(f)
64    }
65}
66impl Copy for UserId {}
67
68impl Display for RecipeParentId {
69    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
70        self.value.fmt(f)
71    }
72}
73impl Copy for RecipeParentId {}