radicle_surf/
stats.rs

1// This file is part of radicle-surf
2// <https://github.com/radicle-dev/radicle-surf>
3//
4// Copyright (C) 2019-2020 The Radicle Team <dev@radicle.xyz>
5//
6// This program is free software: you can redistribute it and/or modify
7// it under the terms of the GNU General Public License version 3 or
8// later as published by the Free Software Foundation.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <https://www.gnu.org/licenses/>.
17
18#[cfg(feature = "serde")]
19use serde::Serialize;
20
21/// Stats for a repository
22#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "camelCase"))]
23#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
24pub struct Stats {
25    /// Number of commits
26    pub commits: usize,
27    /// Number of local branches
28    pub branches: usize,
29    /// Number of contributors
30    pub contributors: usize,
31}