aboutsummaryrefslogtreecommitdiff
path: root/common/src/api.rs
blob: bf79cc0756736e3c2842dd74c584bc333c2b2bdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
    This file is part of jellything (https://codeberg.org/metamuffin/jellything)
    which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
    Copyright (C) 2026 metamuffin <metamuffin.org>
*/

use jellyobject::{Object, Tag};
use std::borrow::Cow;
use std::collections::BTreeMap;

#[derive(Debug)]
pub struct Nku<'a> {
    pub node: Cow<'a, Object>,
    pub userdata: Cow<'a, Object>,
    pub role: Option<&'a str>,
}

pub struct Stats {
    pub all: StatsBin,
    pub by_kind: BTreeMap<Tag, StatsBin>,
}

pub struct StatsBin {
    pub count: usize,
    pub sum_duration: f64,
    pub max_duration: f64,
    pub max_duration_node: String,
    pub sum_size: u64,
    pub max_size: u64,
    pub max_size_node: String,
}